현재 테이블 뷰가있는 앱을 만드는 중입니다. 제가보기에 첫 번째 행을 클릭하면 view1이 표시되고 두 번째 행을 클릭하면 view2가 표시됩니다. 내가 어떻게 할 수 있니? 테이블 뷰는 클릭 한 행에 따라 다른 뷰를 엽니 다.
가 나는 경우 else 문 ID를 사용하려고 내didSelectRowAtIndexPath
하지만 코드의 내 작품은 여기에 작동하지 않았다
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
int EntryIndex = [indexPath indexAtPosition:[indexPath length]-1];
{
AboutViewController *aboutView = [[AboutViewController alloc]init];
aboutView.getId4 = [[contentArray objectAtIndex:EntryIndex]objectForKey:@"title"];
aboutView.aboutofficeId = getId3;
[self.navigationController pushViewController:aboutView animated:YES];
}
else
{
DepartmentsViewController *deptView = [[DepartmentsViewController alloc]init];
deptView.getId5 = [[contentArray objectAtIndex:EntryIndex]objectForKey:@"title"];
deptView.deptoffice = getId3;
[self.navigationController pushViewController:deptView animated:YES];
}
}
U 내가 새로운있는 UIViewController를 추가 할 UIView의 또는있는 UIViewController >> – iPatel
을 추가 WNT :) –