我已经开始了一个只使用 iPhone 作为其默认设备的项目,但现在我也想在 iPad 版本中使用这个项目。
我采用了 iPad .xib UIView 和 didFinishLaunching: 方法中使用的所有编码
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
} else {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewControlleriPad" bundle:nil];
}
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
但是当我运行项目时,会出现显示此消息的错误
2013-03-29 11:59:06.339 动画[800:11303] * 由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:'-[UIViewController _loadViewFromNibNamed:bundle:] 加载了“ViewControlleriPad”笔尖,但视图出口没有放。' * First throw call stack: (0x159b012 0x12a8e7e 0x159adeb 0x2cd8c8 0x2cddc8 0x2cdff8 0x2ce232 0x21d3d5 0x21d76f 0x21d905 0x226917 0x21eb 0x1ea157 0x1ea747 0x1eb94b 0x1fccb5 0x1fdbeb 0x1ef698 0x25fddf9 0x25fdad0 0x1510bf5 0x1510962 0x1541bb6 0x1540f44 0x1540e1b 0x1eb17a 0x1ecffc 0x1e2d 0x1d55) libc++abi.dylib: terminate called throwing an exception
有谁知道这是什么错误???我该如何解决这个问题?提前致谢 :-)
编辑: