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 Cha开发者_如何学Cnge 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
Did you try changing:
[self.navigationController pushViewController:rvController animated:YES];
to
[self.navigationController pushViewController:rvController animated:YES];
精彩评论