In the iPad SplitView template, where's the code that specifies which views are to be used in the Sp

Posted by Dr Dork on Stack Overflow See other posts from Stack Overflow or by Dr Dork
Published on 2010-05-13T04:57:43Z Indexed on 2010/05/13 5:04 UTC
Read the original article Hit count: 398

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];
   MySecondViewController* 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 specifies which views should be added to the SplitView. Here's the code from the SplitView template...

- (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;
}

Thanks in advance for all your help! I'm going to continue researching this question right now.

© Stack Overflow or respective owner

Related posts about ipad

Related posts about ipad-splitview