【发布时间】:2012-01-24 06:25:43
【问题描述】:
我有一个项目数组,并且数组包含字符串值和 id。我想从表视图行选择的数组中获取 id。如果我选择任何行,那么 id 应该传递下一个视图类来更新下一个视图的数据。 我尝试了,但我混淆了如何将 id 与所有数据传递到下一个视图进行更改
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[MyTableview deselectRowAtIndexPath:indexPath animated:YES];
if (self.editing) {
//Here
//modal is my class where i create all string variable and id variable to get database value
// here i want to pass id with next view please help here how to pass id at indexpath.row
modal* a=(modal*)[listitems objectAtIndex:indexPath.row];
if ([self.lstTasks objectAtIndex:indexPath.row]==(NSInteger) a.Id)
EditTask* content = [[EditTask alloc] initWithNibName:@"EditTask" bundle:nil];
content.navigationItem.title = @"Edit Task";
navController = [[UINavigationController alloc] initWithRootViewController: content];
_popover = [[UIPopoverController alloc]
initWithContentViewController:navController];
[content release];
[navController release];
_popover = [[UIPopoverController alloc]
initWithContentViewController:navController];
_popover.popoverContentSize = CGSizeMake(350, 450);
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
[_popover presentPopoverFromRect:cell.bounds inView:cell.contentView
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
//}
}
}
【问题讨论】:
标签: iphone objective-c