我在做一個應用程序,將有一個VC做類似的工作作爲一個的UITabBarController和我使用包含UIViewControllers - 我應該使用.xib還是故事板?
[self addChildViewController:theViewController];
// [self addSubview ... etc
把一個自定義的UIViewController的觀點作爲我的主(根),VC的一個子視圖。
所以我的問題是,這是實例化一個VC的正確方法,而不必編程構建它的UI - 從.xib文件或故事板?
隨着廈門國際銀行:
UICustomViewController *controller = [[UICustomViewController alloc] initWithNibName:@"customVC" bundle:nil];
有了記事板:
UICustomViewController* child = [self.storyboard instantiateViewControllerWithIdentifier:identifier];
相信的.xib文件是舊的東西和故事是要走的路,但我也看過this article,這表明使用故事板來做到這一點有點冒失。我不知道,有什麼想法?