- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CI= @"GenusNameCell";
GenusNameCell *cell = [tableView dequeueReusableCellWithIdentifier:CI];
if (cell == nil) {
cell = [[GenusNameCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:@"GenusNameCell"];
[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
}
int row = [indexPath row];
cell.GenusNameLabel.text = [genusName objectAtIndex:indexPath.row];
cell.GenusCommonNameLabel.text = _genusCommonName[row];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
SpeciesViewController *Species = [[SpeciesViewController alloc] initWithNibName:@"SpeciesViewController" bundle:nil];
if ([[genusName objectAtIndex:indexPath.row] isEqual:@"Abelia"]) {
Species.SpeciesInt = 0;
[Species setTitle:[genusName objectAtIndex:indexPath.row]];
}
}
연결하려면 2 개의 tableviews가 있지만이 코드와 함께 할 것인지 잘 모르겠습니다. 그것은 내가 충돌 셀을 클릭하면 실행됩니다. 누군가 나를 도울 수 있습니까?tableview에서 tableview로 푸는 방법
그렇다면 왜이 코드를 포함하고'didSelectRowAtIndexPath : ... '의 코드가 아닌가? –
가 구현 한 - (무효)있는 tableView : (jQuery과 *)있는 tableView didSelectRowAtIndexPath : (NSIndexPath *) indexPath – Jared
- (무효)있는 tableView : (jQuery과 *)있는 tableView didSelectRowAtIndexPath : (NSIndexPath *) indexPath { SpeciesViewController * 종 = [ [SpeciesViewController alloc] initWithNibName : @ "SpeciesViewController"번들 : nil]; if ([[genusName objectAtIndex : indexPath.row] isEqual : @ "Abelia"]) { Species.SpeciesInt = 0; [Species setTitle : [genusName objectAtIndex : indexPath.row]]; } – user3228210