Wednesday, May 16, 2012

iPad application with multiple DetailView and have navigation in detailview

i search for a way to have multiple detail view in iPad application and i find the sample code in apple developer site http://developer.apple.com/library/ios/#samplecode/MultipleDetailViews/Introduction/Intro.html , but now i want to have navigation in detail view which this sample does not cover, i add uinavigationcontroller to detail view as :



-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
ReportsViewController_iPad *master = [[ReportsViewController_iPad alloc] initWithNibName:@"ReportsViewController_iPad" bundle:nil];

DetailViewController_iPad *detail = [[DetailViewController_iPad alloc] initWithNibName:@"DetailViewController_iPad" bundle:nil];

UINavigationController *masterNavController = [[[UINavigationController alloc] initWithRootViewController:master ] autorelease];

UINavigationController *detailNavController = [[[UINavigationController alloc] initWithRootViewController:detail ] autorelease];

splitViewController.viewControllers = [NSArray arrayWithObjects:masterNavController , detailNavController, nil];

[window addSubview:splitViewController.view];
[window makeKeyAndVisible];

return YES;
}


but when i run the sample i got error



[UINavigationController showRootPopoverButtonItem:]: unrecognized selector sent to instance...



showRootPopoverButtonItem is a method define in a protocol in RootViewController



@protocol SubstitutableDetailViewController
- (void)showRootPopoverButtonItem:(UIBarButtonItem *)barButtonItem;
- (void)invalidateRootPopoverButtonItem:(UIBarButtonItem *)barButtonItem;
@end



So Thanks inadvance





No comments:

Post a Comment