NSInternalInconsistencyException 无法在包中加载笔尖
我创建了一个儿童游戏应用程序。
每轮加载 12 个不同的问题。第四轮后,应用程序崩溃并显示以下日志:
ImageIO: CGImageRead_mapData 'open' failed '/var/mobile/Applications/4B0202F9-5961-4AC7-A327-604620AF1F94/test.app/pi_ok.png'
error = 24 (Too many open files)
2011-03-24 02:26:34.743 [424:707] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </var/mobile/Applications/4B0202F9-5961-4AC7-A327-604620AF1F94/VisualMath.app> (loaded)' with name 'ThemePickerController''
*** Call stack at first throw:
(
0 CoreFoundation 0x3182464f __exceptionPreprocess + 114
1 libobjc.A.dylib 0x3651dc5d objc_exception_throw + 24
2 CoreFoundation 0x31824491 +[NSException raise:format:arguments:] + 68
3 CoreFoundation 0x318244cb +[NSException raise:format:] + 34
4 UIKit 0x330d2a53 -[UINib instantiateWithOwner:options:] + 1110
5 UIKit 0x330d3e09 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 92
6 UIKit 0x3304d5e9 -[UIViewController _loadViewFromNibNamed:bundle:] + 36
7 UIKit 0x3301afa5 -[UIViewController loadView] + 80
8 UIKit 0x32effebf -[UIViewController view] + 30
9 VisualMath 0x00062875 -[DragTriangleViewController hideThemePicker] + 40
10 VisualMath 0x0005fe93 -[DragTriangleViewController clickDone] + 26
11 CoreFoundation 0x31794571 -[NSObject(NSObject) performSelector:withObject:withObject:] + 24
12 UIKit 0x32ee5ec9 -[UIApplication sendAction:to:from:forEvent:] + 84
13 UIKit 0x32ee5e69 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 32
14 UIKit 0x32ee5e3b -[UIControl sendAction:to:forEvent:] + 38
15 UIKit 0x32ee5b8d -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 356
16 UIKit 0x32ee6423 -[UIControl touchesEnded:withEvent:] + 342
17 UIKit 0x32ee4bf5 -[UIWindow _sendTouchesForEvent:] + 368
18 UIKit 0x32ee456f -[UIWindow sendEvent:] + 262
19 UIKit 0x32ecd313 -[UIApplication sendEvent:] + 298
20 UIKit 0x32eccc53 _UIApplicationHandleEvent + 5090
21 GraphicsServices 0x32977e77 PurpleEventCallback + 666
22 CoreFoundation 0x317fba97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
23 CoreFoundation 0x317fd83f __CFRunLoopDoSource1 + 166
24 CoreFoundation 0x317fe60d __CFRunLoopRun + 520
25 CoreFoundation 0x3178eec3 CFRunLoopRunSpecific + 230
26 CoreFoundation 0x3178edcb CFRunLoopRunInMode + 58
27 GraphicsServices 0x3297741f GSEventRunModal + 114
28 GraphicsServices 0x329774cb GSEventRun + 62
29 UIKit 0x32ef7d69 -[UIApplication _run] + 404
30 UIKit 0x32ef5807 UIApplicationMain + 670
31 VisualMath 0x00002207 main + 70
32 VisualMath 0x000021bc start + 40
)
我尝试了很多选项,但没有一个有效,请帮助我。
I've created an application for child game.
It loads 12 different questions for each round. After the 4th round the app crashes with the following log:
ImageIO: CGImageRead_mapData 'open' failed '/var/mobile/Applications/4B0202F9-5961-4AC7-A327-604620AF1F94/test.app/pi_ok.png'
error = 24 (Too many open files)
2011-03-24 02:26:34.743 [424:707] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </var/mobile/Applications/4B0202F9-5961-4AC7-A327-604620AF1F94/VisualMath.app> (loaded)' with name 'ThemePickerController''
*** Call stack at first throw:
(
0 CoreFoundation 0x3182464f __exceptionPreprocess + 114
1 libobjc.A.dylib 0x3651dc5d objc_exception_throw + 24
2 CoreFoundation 0x31824491 +[NSException raise:format:arguments:] + 68
3 CoreFoundation 0x318244cb +[NSException raise:format:] + 34
4 UIKit 0x330d2a53 -[UINib instantiateWithOwner:options:] + 1110
5 UIKit 0x330d3e09 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 92
6 UIKit 0x3304d5e9 -[UIViewController _loadViewFromNibNamed:bundle:] + 36
7 UIKit 0x3301afa5 -[UIViewController loadView] + 80
8 UIKit 0x32effebf -[UIViewController view] + 30
9 VisualMath 0x00062875 -[DragTriangleViewController hideThemePicker] + 40
10 VisualMath 0x0005fe93 -[DragTriangleViewController clickDone] + 26
11 CoreFoundation 0x31794571 -[NSObject(NSObject) performSelector:withObject:withObject:] + 24
12 UIKit 0x32ee5ec9 -[UIApplication sendAction:to:from:forEvent:] + 84
13 UIKit 0x32ee5e69 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 32
14 UIKit 0x32ee5e3b -[UIControl sendAction:to:forEvent:] + 38
15 UIKit 0x32ee5b8d -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 356
16 UIKit 0x32ee6423 -[UIControl touchesEnded:withEvent:] + 342
17 UIKit 0x32ee4bf5 -[UIWindow _sendTouchesForEvent:] + 368
18 UIKit 0x32ee456f -[UIWindow sendEvent:] + 262
19 UIKit 0x32ecd313 -[UIApplication sendEvent:] + 298
20 UIKit 0x32eccc53 _UIApplicationHandleEvent + 5090
21 GraphicsServices 0x32977e77 PurpleEventCallback + 666
22 CoreFoundation 0x317fba97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
23 CoreFoundation 0x317fd83f __CFRunLoopDoSource1 + 166
24 CoreFoundation 0x317fe60d __CFRunLoopRun + 520
25 CoreFoundation 0x3178eec3 CFRunLoopRunSpecific + 230
26 CoreFoundation 0x3178edcb CFRunLoopRunInMode + 58
27 GraphicsServices 0x3297741f GSEventRunModal + 114
28 GraphicsServices 0x329774cb GSEventRun + 62
29 UIKit 0x32ef7d69 -[UIApplication _run] + 404
30 UIKit 0x32ef5807 UIApplicationMain + 670
31 VisualMath 0x00002207 main + 70
32 VisualMath 0x000021bc start + 40
)
I have tried many options but none works, please help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
在项目中->构建阶段
确保 .xib 已添加到复制捆绑资源
In project -> Build Phases
Make sure the .xib is added to Copy Bundle Resources
看起来您正在尝试实例化一个名为 ThemePickerController.nib 的笔尖,但它不存在。笔尖是否包含在项目成员中?
It looks like you're trying to instantiate a nib called ThemePickerController.nib and it isn't present. Is the nib included as a project member?
另一个常见问题是尝试在 viewController 的 init 方法中加载 nib。应该在 viewDidLoad 中。
Another common issue is trying to load a nib in the init methods of viewControllers. Should be in viewDidLoad.
这很简单...选择 XIB 文件并确保在“目标成员资格”部分(在“显示文件检查器”选项卡下)下检查项目所需的目标,然后您的问题就解决了。
当您复制现有文件并手动添加到项目时,通常会发生这种情况,因为在这种情况下,您还应该手动检查上述目标。
It is easy... select the XIB file and make sure the desired target of the project is checked under the "Target Membership" section (under the "Show the file inspector" tab), and your problem is solved.
It is usually happening when you made a copy of an exists file and added to the project manually because in that case you should check the above mentioned target manually as well.
设置您的按钮单击图像,如下所示:
而不是这样:
它有效..
set your button click image like this :
instead of this :
It works..
您可以重命名应在 AppDelegate 文件中更新的 ViewController,因此导航到 AppDelegate.m 并执行以下操作。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.viewController = [[XXXXViewController alloc] initWithNibName:@"XXXXXViewController" bundle:nil];
在该 XXXX 中重命名您最新的 ViewController 名称(即重命名为 ViewControllerName)。现在就可以了。
You may renamed your ViewController That should be updated in AppDelegate file so navigate to AppDelegate.m and do the following.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.viewController = [[XXXXViewController alloc] initWithNibName:@"XXXXXViewController" bundle:nil];
In that XXXX rename your latest ViewController name(i.e renamed ViewControllerName).Now It will work .
基础国际化有可能会导致崩溃并显示相同的错误消息,因为 该功能仅支持 iOS 5 及以上版本!
但是,由于您可以启动该应用程序,并且它在一段时间后才崩溃,因此这不应该是由于基础国际化造成的。
There is a chance that Base Internationalization will cause a crash with the same error message, because the feature is only supported in iOS 5 and above!
However, since you can start the app and it crash only after a while, it should not be due to Base Internationalization.