1.如果vc都是通過xib來生成的,沒什么問題,但是如果只是直接init生成的話,UIViewController會(huì)在loadview的時(shí)候自動(dòng)創(chuàng)建一個(gè)view,賦值給vc的view,但是NSViewController不會(huì)自動(dòng)創(chuàng)建view,需要自己在loadview中創(chuàng)建view。如果NSViewController不創(chuàng)建view的話,雖然走了loadview方法,但是由于(Called after the view has been loaded.)self.view沒有被創(chuàng)建,所以導(dǎo)致viewDidLoad不會(huì)被創(chuàng)建!
/* Called after the view has been loaded. For view controllers created in code, this is after -loadView. For view controllers unarchived from a nib, this is after the view is set. Default does nothing.
*/
- (void)viewDidLoad NS_AVAILABLE_MAC(10_10);
未完待續(xù)......