你好,我只是一个初学者。加载一个xib文件
我已经创建了一个新的xib文件。现在我试图把它称为下面的代码,但它不起作用。
这是我在文件的所有者已完成:
UIViewController *controller;
controller = [[UIViewController alloc]initWithNibName:@"UserFeedback" bundle:nil];
[self.view addSubview:controller.view];
,我得到的错误是:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "UserFeedback" nib but the view outlet was not set.'
不要使用使用UIViewController只是使UIViewController的子类和使用该子类。而且xib也必须映射到该子类。 – Exploring 2013-02-13 06:25:07
http://stackoverflow.com/questions/4763519/loaded-nib-but-the-view-outlet-was-not-set-new-to-interfacebuilder – 2013-02-13 06:54:43
我怀疑它是否设置为适当的类AFMoviePlayerController或不。 – 2013-02-13 06:55:49