使用 SplitView 在 UitableView 中进行钻取
我正在使用 SplitView 模板在 UITableView 中创建钻取,就像在邮件中完成的那样。根据教程,我创建了适用于基于导航的模板的代码。
我尝试将其修改为分割视图模板。
(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
I am creating a drilldown in UITableView using SplitView Template as done in mail. From a tutorial I created the code that worked fine for a navigation based template.
I tried to modify it for a split view template.
(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];
}
}
How do I have to change the code? The Line in Red is Crashing the Code. How do I Change my Code
I have solved my Query i am attaching the sample application if anybody want to achieve the same thing then my solution will point them at some path here is the link of the
iPhone Application : http://www.mediafire.com/?nszdqqdht9ceakb
iPad SplitView Application : http://www.mediafire.com/?861jggve88o8tp8
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试更改
:
Did you try changing:
to