简单的iPhone应用程序启动后即可EXC_BAD_ACCESS [英] EXC_BAD_ACCESS upon simple iPhone app startup

查看:121
本文介绍了简单的iPhone应用程序启动后即可EXC_BAD_ACCESS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:

我正在CS193P课程中尝试"HelloPoly"作业. 我已经创建了.xib文件和自定义Controller类.

I'm trying out the "HelloPoly" assignment in the CS193P course. I've created my .xib file, and a custom Controller class.

我还没有充实任何方法-我只允许IB将类文件写入xcode.

I haven't fleshed out any methods - I've only allowed IB to write the class files into xcode.

问题:

每次我启动应用程序时,它都会爆炸.当我运行gdb时,我看到它是一个EXC_BAD_ACCESS错误.这意味着我正在访问内存中不存在的内容,对吗?问题是,我所拥有的只是IB和main创建的默认文件.没什么.

Every single time I startup the application, it bombs out. When I run gdb I see it's an EXC_BAD_ACCESS error. This means I'm accessing something non-existent in memory right? Thing is, all I have is the default files created by IB and the main. Nothing more.

我已经检查了已发布的代码解决方案,以了解有什么不同,并且不确定下一步该怎么做.你们每次启动时应用程序崩溃时通常会检查什么?

I've checked posted code solutions to see what's different and I'm not sure what to try next. What do you guys usually check for when your app crashes every time on startup?

在创建UIApplicationMain时,堆栈跟踪揭示了它在main.m中发生的情况-这意味着我从未将其提交给我的应用程序委托.

The stack trace reveals it's happening in main.m when creating UIApplicationMain - meaning I never make it to my application delegate.

这是痕迹:

Program received signal:  "EXC_BAD_ACCESS".
(gdb) where
#0  0x01b70d45 in CFHash ()
#1  0x01b741cf in __CFDictionaryFindBuckets1b ()
#2  0x01b72b0a in CFDictionaryGetValue ()
#3  0x00450535 in -[UIProxyObject initWithCoder:] ()
#4  0x0133886e in UINibDecoderDecodeObjectForValue ()
#5  0x013398c2 in -[UINibDecoder decodeObjectForKey:] ()
#6  0x00450b35 in -[UIRuntimeConnection initWithCoder:] ()
#7  0x0045101c in -[UIRuntimeEventConnection initWithCoder:] ()
#8  0x0133886e in UINibDecoderDecodeObjectForValue ()
#9  0x0133820a in UINibDecoderDecodeObjectForValue ()
#10 0x013398c2 in -[UINibDecoder decodeObjectForKey:] ()
#11 0x0044feab in -[UINib instantiateWithOptions:owner:loadingResourcesFromBundle:] ()
#12 0x00451fcb in -[NSBundle(NSBundleAdditions) loadNibNamed:owner:options:] ()
#13 0x002910a6 in -[UIApplication _loadMainNibFile] ()
#14 0x0029a82a in -[UIApplication _runWithURL:sourceBundleID:] ()
#15 0x00297b88 in -[UIApplication handleEvent:withNewEvent:] ()
#16 0x002936d3 in -[UIApplication sendEvent:] ()
#17 0x0029a0b5 in _UIApplicationHandleEvent ()
#18 0x0239eef1 in PurpleEventCallback ()
#19 0x01bb2b80 in CFRunLoopRunSpecific ()
#20 0x01bb1c48 in CFRunLoopRunInMode ()
#21 0x00291e69 in -[UIApplication _run] ()
#22 0x0029b003 in UIApplicationMain ()
#23 0x000026a8 in main (argc=1, argv=0xbffff000) at main.m:14

在其他线程中我没有看到这个特定问题,但是如果我错过了它们,请帮我提示.

I didn't see this particular problem in other threads, but please clue me in if I missed them.

想法?

谢谢.

推荐答案

在NibDecoder中崩溃,即在加载XIB文件时崩溃.您可能在其中引用了一个不存在或未初始化的对象或属性.

It's crashing in NibDecoder, i.e. when loading your XIB files. You probably have a reference in there to an object or property that doesn't exist or isn't initialized.

这篇关于简单的iPhone应用程序启动后即可EXC_BAD_ACCESS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆