Sean's Note: 在 didFinishLaunchingWithOptions 時不使用 storyboard 直接載入 nib 檔

2016年3月23日 星期三

在 didFinishLaunchingWithOptions 時不使用 storyboard 直接載入 nib 檔

  
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] ;

     // Override point for customization after application launch.

     MyViewController *test = [[MyViewController alloc]     initWithNibName:@"MyViewController" bundle:nil];
     UINavigationController *nav = [[UINavigationController alloc]  initWithRootViewController:test];
     self.window.rootViewController = nav;

     [self.window makeKeyAndVisible];

     return YES;
  }

沒有留言:

張貼留言