私はナビゲーションベースのアプリケーションに取り組んでいます。私のrootViewControllerには3つのセルが含まれています-最初のセルが押されると、UIViewControllerがプッシュされます(これは機能します)-問題は、UITableViewControllerをプッシュするはずの2番目と3番目のセルにあります
アプリはエラーなしで実行されており、まったくクラッシュしていませんが、テーブルビューに移動すると、要素が含まれていない空のテーブルが表示されます。
コードのこの部分に問題がありますか?? :
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UIViewController *detailViewController = [[UIViewController alloc] initWithNibName:@"Introduction" bundle:nil];
detailViewController.title=@"Introduction";
UITableViewController *myPictures = [[UITableViewController alloc] initWithNibName:@"Pictures" bundle:nil];
myPictures.title=@"Pictures";
UITableViewController *myImages = [[UITableViewController alloc] initWithNibName:@"ImagesViewController" bundle:nil];
myImages.title=@"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];