我想在单元格上传递特定的ID。如果用户需要更改配置文件,然后他/她在单击编辑按钮后单击编辑按钮,表视图将进入编辑模式。如果用户单击任何单元格,则编辑页面将调用更新值。因此,如何在单元格选择时传递ID。因此,用户可以从编辑类更改分区行的值
我用-(void)update方法创建了一个modle类,我给了所有sqlite对象以进行更改,但如何在单元格选择时传递更新方法的Id,请帮助我
如何在此处传递用于更新paticular细胞值的id应该更改mu p*主要id是TaskID*
这是我编辑类的代码
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[MyTableview deselectRowAtIndexPath:indexPath animated:YES];
if (self.editing) {
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];
}
}
就是这样。在选择事件中
NSString *strid = [NSString stringWithFormat:@"%d",indexPath.row];
所以stride是你的id。