我想创建一个方法,将字符串对象“tableColorName”更改为所选单元格。 tableData NSArray
由对象组成:“红色”,“蓝色”,“绿色”。如果选择了红色,我想将字符串“tableColorName”保存为redColor
,如果是蓝色,则保存为blueColor
,如果是绿色,则保存为greenColor
。选中单元格后,我想让viewController回到根目录。我感谢您的帮助提前:在表IOS中选择单元格
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
int theRow = indexPath.row;
NSString *tableColorName;
tableColorName = [[NSString alloc] initWithString:([_tableData [theRow] stringValue],@"Color")];
[self.navigationController popToRootViewControllerAnimated:YES];
}
你能告诉我们'cellForRowAtIndexPath'方法 – 2013-03-15 03:17:02