ShowViewController *showMessage = [[ShowViewController alloc]
initWithNibName:@"ShowViewController" bundle:nil];
self.showViewController = showMessage;
[showMessage release];
2.VideoCellController的loadNibNamed方法NSArray * nib =[[NSBundle mainBundle]loadNibNamed:@"Save3ViewController"
owner:self options:nil];
self.showViewController = [nib lastObject];
[nib
objectAtIndex:0];如果用 loadNibNamed 加载 initWithNibName 用到格式的 xib 文件,就会报错误:
setValue:forUndefinedKey
loaded the...nib but the view outlet was not set
loadNibNamed和initWithNibName需要加载的xib文件是不一样的。initWithNibName需要加载的xib文件的File Owner应改是需要加载的类,
而loadNibNamed需要加载的xib文件的File Owner为NSObject。
http://www.cnblogs.com/GoGoagg/archive/2011/06/09/2076456.html
when using loadNibNamed:owner:options:, the File's Owner should be NSObject, the main view should be your class type, and all outlets should be hooked up to the view, not the File's Owner.
http://stackoverflow.com/questions/46220/iphone-app-crashing-error-question
参考资料:
从xib/nib加载UIViewController/或其子类
http://www.cnblogs.com/GoGoagg/archive/2011/06/09/2076456.html
iPhone App Crashing - Error Question
http://stackoverflow.com/questions/46220/iphone-app-crashing-error-question