我正在使用UITableView模板创建SplitView中的钻取,就像在邮件中一样。在一篇教程中,我创建了用于基于导航的模板的代码。
我试图将其修改为拆分视图模板。
(void)tableView:(UITableView *)TableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//Get the dictionary of the selected data source.
NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row];
//Get the children of the present item.
NSArray *Children = [dictionary objectForKey:@"Children"];
if([Children count] == 0) {
detailViewController.detailItem = [dictionary objectForKey:@"Title"];
}
else {
//Prepare to tableview.
RootViewController *rvController = [[RootViewController alloc]initWithNibName:@"RootViewController" bundle:[NSBundle mainBundle]
//Increment the Current View
rvController.CurrentLevel += 1;
//Set the title;
rvController.CurrentTitle = [dictionary objectForKey:@"Title"];
//Push the new table view on the stack
[COLOR="Red"][B] [self.navigationController pushViewController:rvController animated:YES];[/B][/COLOR]
rvController.tableDataSource = Children;
[rvController release];
}
}我要怎么修改代码?红色线正在破坏密码。如何更改我的代码
我已经解决了我的查询,我正在附加示例应用程序,如果有人想达到同样的目的,那么我的解决方案将指向他们的某个路径,这里是
iPhone应用程序:http://www.mediafire.com/?nszdqqdht9ceakb
iPad SplitView应用程序:http://www.mediafire.com/?861jggve88o8tp8
发布于 2011-03-02 13:44:28
你试过换衣服吗?
[self.navigationController pushViewController:rvController animated:YES]; 至
[self.navigationController pushViewController:rvController animated:YES];https://stackoverflow.com/questions/5164180
复制相似问题