내비게이션 기반 응용 프로그램을 만들고 있습니다. 내 rootViewController가 첫 번째가있는 UIViewController를 누르면 - 언제 가 밀려 3 개 세포를 포함 년 - 문제는 응용 프로그램이 더 실행되지 않는있는 UITableViewControlleriphone UITableVIew (내비게이션 기반)
을 추진하기로되어있는 2 층과 3 세포와 (이 작품) 오류가 발생하지 않으며 전혀 충돌하지 않지만 tableview로 이동하면 빈 테이블이 요소없이 표시됩니다.
코드의이 부분에 문제가 있습니까 ?? :
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UIViewController *detailViewController = [[UIViewController alloc] initWithNibName:@"Introduction" bundle:nil];
[email protected]"Introduction";
UITableViewController *myPictures = [[UITableViewController alloc] initWithNibName:@"Pictures" bundle:nil];
[email protected]"Pictures";
UITableViewController *myImages = [[UITableViewController alloc] initWithNibName:@"ImagesViewController" bundle:nil];
[email protected]"Images";
// Pass the selected object to the new view controller.
if (0 == indexPath.row)
[self.navigationController pushViewController:detailViewController animated:YES];
if (1== indexPath.row)
[self.navigationController pushViewController:myPictures animated:YES];
if (2== indexPath.row)
[self.navigationController pushViewController:myImages animated:YES];
[detailViewController release];
[myPictures release];
[myImages release];
당신은 당신의 viewControllers 경우에만의 인스턴스를 생성한다 그 행은 당신의 메모리 사용량을 최소화하도록 선택되었습니다. "그러나 내가 tableview로 이동했을 때"의 의미를 설명 할 수 있습니까? viewController를 보여줄 셀을 클릭하여 말합니까? –
예, c 물론 셀 ... 답장을 –