didFinishLaunchingWithOptions method that just creates a custom UIViewController


/ Published in: Objective C
Save to your folder(s)

Inside the `AppDelegate`, the `didFinishLaunchingWithOptions` method can be used to just create and use a custom View Controller class.


Copy this code and paste it in your HTML
  1. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  2.  
  3. // create an instance of the view controller
  4. MyViewController *vc = [[MyViewController alloc] init];
  5.  
  6. // add the view controllers view to the window
  7. [window addSubview:[vc view]];
  8.  
  9. // release vc (we're done with it)
  10. [vc release];
  11.  
  12. // make key and visible of course!
  13. [window makeKeyAndVisible];
  14.  
  15. // happy times
  16. return YES;
  17. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.