ios - '无法在包 : 'NSBundle | Error while switching to Xcode 4 and creating an iPad version of an app 中加载 NIB

标签 ios xcode xib nib xcode3to4

当我点击任何按钮时,在出现此错误之前效果很好:

2011-07-04 00:52:38.772 RPS-iPad[10930:207] *** Terminating app due to uncaught
exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 
'NSBundle </Users/Jared/Library/Application Support/iPhone 
Simulator/4.3/Applications/CA94658E-A732-4D51-BA50-0058E01C255F/RPS-iPad.app> (loaded)' 
with name 'FlipsideView''

*** Call stack at first throw:
(
0   CoreFoundation                      0x00dc75a9 __exceptionPreprocess + 185
1   libobjc.A.dylib                     0x00f1b313 objc_exception_throw + 44
2   CoreFoundation                      0x00d7fef8 +[NSException raise:format:arguments:] + 136
3   CoreFoundation                      0x00d7fe6a +[NSException raise:format:] + 58
4   UIKit                               0x004b20fa -[UINib instantiateWithOwner:options:] + 2024
5   UIKit                               0x004b3ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
6   UIKit                               0x00369628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
7   UIKit                               0x00367134 -[UIViewController loadView] + 120
8   UIKit                               0x0036700e -[UIViewController view] + 56
9   UIKit                               0x00368a3d -[UIViewController viewControllerForRotation] + 63
10  UIKit                               0x00364988 -[UIViewController _visibleView] + 90
11  UIKit                               0x0060693c -[UIClientRotationContext initWithClient:toOrientation:duration:andWindow:] + 354
12  UIKit                               0x002de81e -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 954
13  UIKit                               0x00566619 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 1381
14  UIKit                               0x0036b65d -[UIViewController presentModalViewController:withTransition:] + 3478
15  RPS-iPad                            0x00003886 -[RPSViewController score:] + 199
16  UIKit                               0x002b74fd -[UIApplication sendAction:to:from:forEvent:] + 119
17  UIKit                               0x00347799 -[UIControl sendAction:to:forEvent:] + 67
18  UIKit                               0x00349c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
19  UIKit                               0x003487d8 -[UIControl touchesEnded:withEvent:] + 458
20  UIKit                               0x002dbded -[UIWindow _sendTouchesForEvent:] + 567
21  UIKit                               0x002bcc37 -[UIApplication sendEvent:] + 447
22  UIKit                               0x002c1f2e _UIApplicationHandleEvent + 7576
23  GraphicsServices                    0x0171f992 PurpleEventCallback + 1550
24  CoreFoundation                      0x00da8944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
25  CoreFoundation                      0x00d08cf7 __CFRunLoopDoSource1 + 215
26  CoreFoundation                      0x00d05f83 __CFRunLoopRun + 979
27  CoreFoundation                      0x00d05840 CFRunLoopRunSpecific + 208
28  CoreFoundation                      0x00d05761 CFRunLoopRunInMode + 97
29  GraphicsServices                    0x0171e1c4 GSEventRunModal + 217
30  GraphicsServices                    0x0171e289 GSEventRun + 115
31  UIKit                               0x002c5c93 UIApplicationMain + 1160
32  RPS-iPad                            0x00001f54 main + 102
33  RPS-iPad                            0x00001ee5 start + 53
34  ???                                 0x00000001 0x0 + 1
)

在抛出“NSException”实例后调用终止

在 Xcode 3 中一切正常,但我最近切换到 Xcode 4,我知道遇到了这个问题。此外,我最近在我的应用程序上使用了 iPad 副本选项。它在 iPhone 模拟器上运行良好。谢谢。

这是来自一个被复制的 .xib 文件。我检查了它是否正确链接并且文件名为 NAME~iPad.xib。而且,它们都与 Project 相关。

最佳答案

一些提示:

1)你确定这个名字写得好吗(“FlipsideView”)?

2)文件是否添加到构建中?

希望对你有帮助

关于ios - '无法在包 : 'NSBundle | Error while switching to Xcode 4 and creating an iPad version of an app 中加载 NIB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6567523/

相关文章:

ios - 有多少 iOS 开发者可以使用同一个 iOS 开发许可证?

android - 用于繁重计算的 WebAssembly + WebView + Javascript 接口(interface)?

ios - 相机胶卷图像的创建日期

ios - 可以使用自定义 UIViewController 但没有自定义 UIView 类来实现手势识别吗?

ios - WKWebView 确实从本地文档文件夹加载资源

ios - 检查 UITableViewAutomaticDimension 返回 -1

xcode - 用户需要连接到互联网才能使用我的应用程序吗?

ios - 在 Xcode 7 中导入自己的 Swift Cocoa Touch Framework 时出错

inheritance - UITableViewCell继承

ios - 倒计时模式下的 UIDatePicker : Can I have a countdown thats longer than 23:59?