In the iPad SplitView template, where's the code that specifies which views are to be used in the SplitView?
In the iPad Programming Guide, it gives the following code example for specifying the two views (firstVC and secondVC) that will be used in the SplitView...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
MyFirstViewController* firstVC = [[[MyFirstViewController alloc]
initWithNibName:@"FirstNib" bundle:nil] autorelease];
M开发者_C百科ySecondViewController* secondVC = [[[MySecondViewController alloc]
initWithNibName:@"SecondNib" bundle:nil] autorelease];
UISplitViewController* splitVC = [[UISplitViewController alloc] init];
splitVC.viewControllers = [NSArray arrayWithObjects:firstVC, secondVC, nil];
[window addSubview:splitVC.view];
[window makeKeyAndVisible];
return YES;
}
but when I actually create a new SplitView project in Xcode, I don't see any code that says the default rootView and detailView views should be added to the SplitView. Where can I find that?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after app launch
rootViewController.managedObjectContext = self.managedObjectContext;
// Add the split view controller's view to the window and display.
[window addSubview:splitViewController.view];
[window makeKeyAndVisible];
return YES;
}
I'm new to iPhone OS programming and I'm just trying to understand how this all works. Thanks in advance for all your help! I'm going to continue researching this question right now.
It's because the links are set up in the *.nib file already. You could still use the .viewControllers
approach if you don't want to rely on the *.nib to do it automatically.
精彩评论