You need to sign in to do that
Don't have an account?
Mobile SDK iOS - SFNativeRestAppDelegate and UISplitViewController
Hi there,
In AppDelegate inherit from SFNativeRestAppDelegate
I am having problems returning a UISplitViewController in
- (UIViewController*)newRootViewController {
// RootViewController *rootVC = [[RootViewController alloc] initWithNibName:nil bundle:nil];
// UINavigationController *navVC = [[UINavigationController alloc] initWithRootViewController:rootVC];
// [rootVC release];
//
// return navVC;
MasterViewController *masterViewController = [[[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil] autorelease];
UINavigationController *masterNavigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease];
DetailViewController *detailViewController = [[[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil] autorelease];
UINavigationController *detailNavigationController = [[[UINavigationController alloc] initWithRootViewController:detailViewController] autorelease];
UISplitViewController* splitViewController = [[[UISplitViewControlleralloc] init] autorelease];
splitViewController.delegate = detailViewController;
splitViewController.viewControllers = [NSArray arrayWithObjects:masterNavigationController, detailNavigationController, nil];
return splitViewController;
}
I get
'Application tried to present a Split View Controllers modally
I know that iOS require the UISplitViewController to be the rootView, but using the SFNativeRestAppDelegate?
Thanks
You can just override setupNewRootViewController in AppDelegate to keep it from presenting the modal view controller:
All Answers
Try this: It's a pre-configed project using the splitview and mobileSDK:
https://github.com/quintonwall/MobileSDK-SplitView
Ah, this is a bug. SFNativeRestAppDelegate presents the root view controller modally, which is likely what's causing the problem. I'll take a look.
You can just override setupNewRootViewController in AppDelegate to keep it from presenting the modal view controller:
Ah yes, thanks Tom. And I don't believe that will have any adverse impact on the rest of the functionality of SFNativeRestAppDelegate. You should be safe with such an override.
Cheers,
Kevin