【发布时间】:2011-10-01 09:30:26
【问题描述】:
从一个视图中,我推了一个隐藏后退按钮的 tableView。 选择一行时,会出现“返回按钮”。 当用户点击后退按钮作为文本字段的内容时,我想传递给选定行的值。
这是tableView(CategoryListController.m)的代码:
-(NSString *)ritornaValore {
return valoreCategoria;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self.navigationItem setHidesBackButton:NO animated:YES];
NSDictionary *rowVals = (NSDictionary *) [categoryListItems objectAtIndex:indexPath.row];
valoreCategoria = (NSString *) [rowVals objectForKey:@"key"];
[self ritornaValore];
}
valoreCategoria 是在 .h 中声明的 NSString
在 AddItemController 中,我有这个“categoryNameField”,我想将其放入“valoreCategoria”的值中
categoryNameField.text = ?
【问题讨论】:
标签: iphone objective-c uitableview uinavigationcontroller