"tableColorName"문자열 개체를 선택한 셀로 변경하는 메서드를 만들려고합니다. tableData NSArray
은 "red", "blue", "green"개체로 구성됩니다. 빨간색을 선택하는 경우 "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' 메쏘드를 보여줄 수 있습니까 –