哈II每一個身體,我用從一個UITableView單元選擇多個值附屬視圖對號,我把這個代碼在didSelectRowAtIndexPath方法如何使用附件視圖複選標記從UITableview單元格獲取多個值?
NSArray* toReload = [NSArray arrayWithObjects: indexPath, self.selectedIndexPath, nil];
self.selectedIndexPath = indexPath;
if ([[tableView cellForRowAtIndexPath:indexPath] accessoryType] == UITableViewCellAccessoryCheckmark){
BOOL selected = [[appDelegate.notesArray objectAtIndex:[indexPath row]] boolValue];
[appDelegate.notesArray replaceObjectAtIndex:[indexPath row] withObject:[NSNumber numberWithBool:!selected]];
[[tableView cellForRowAtIndexPath:indexPath] setAccessoryType:UITableViewCellAccessoryNone];
}
else {
[[tableView cellForRowAtIndexPath:indexPath] setAccessoryType:UITableViewCellAccessoryCheckmark];
}
我需要的是當用戶從UITableView的細胞中選擇多個值,它必須存儲在一個數組中,並將數組傳遞給按鈕click.i希望這些數組能夠在googledoc中共享。如何從UITbleViewCell獲取多個值的數組。我把它放在按鈕單擊中的哪個代碼?以及我想傳遞share.if的值,如果有任何示例代碼供參考,那對我來說會很有幫助。 在此先感謝。 編輯:
- (IBAction)doUpload:(id)sender
{
NSMutableArray *selected_items = [[NSMutableArray alloc] init];
for (int i = 0; i<[appDelegate.notesArray count]; i++) {
if (selected[i]) [selected_items addObject:[appDelegate.notesArray objectAtIndex:i]];
UploadView *uploadview = (UploadView *)self.view;
if (uploadview != nil)
{
[m_owner uploadString:@""];
//[self dismissModalViewControllerAnimated:YES];
}
}
}
可能的重複[如何從中獲取值只有桌面視圖checkmark是配件視圖?](http://stackoverflow.com/questions/8463013/how-to-get-values-from-a-tableview-only-checkmark-is-the-accessory-view) – jrturton