iphone UITableVIew(基于导航)
|
我正在开发基于导航的应用程序。
我的rootViewController包含3个单元格
-当按下第一个按钮时,将按下UIViewController(此工作)
-问题在于应该推送UITableViewController的第二个和第三个单元格
该应用程序正在运行,没有错误,也没有崩溃,但是当我导航到tableview时,将查看其中没有任何元素的空表。
这部分代码有问题吗? :
- (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];
没有找到相关结果
已邀请:
1 个回复
氮顺