文字列オブジェクト「tableColorName」を選択したセルに変更するメソッドを作成しようとしています。tableDataNSArray
は、オブジェクト「red」、「blue」、「green」で構成されます。redColor
赤が選択されているblueColor
場合、青が選択されている場合、緑が選択されている場合は、文字列「tableColorName」を保存しますgreenColor
。セルが選択された後、viewController をルートに戻します。事前にご協力をお願いいたします:
-(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];
}