iPhone只有在设备未连接到xcode时才会崩溃,如何理解崩溃日志?
在运行 ios 5 的设备上,我的应用程序运行良好,但在运行 ios 4.2.1 的设备上,我遇到了此崩溃。 奇怪的是,只有在未连接到 xcode 时设备才会崩溃。 当从 xcode 运行时,它可以工作,但是当我在没有 xcode 的情况下运行它时,应用程序一直工作,直到我调用方法的那一刻:
- (void)startLocationUpdates
{
self.locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;
self.locationManager.distanceFilter = 1;
self.locationManager.delegate = self;
[self.locationManager startUpdatingLocation];
}
崩溃日志:
OS Version: iPhone OS 4.2.1 (8C148)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x3830000f
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x33479462 objc_msgSend + 14
1 CoreLocation 0x34371430 -[CLLocationManager onClientEventLocation:] + 560
2 CoreLocation 0x3436f68e -[CLLocationManager onClientEvent:supportInfo:] + 98
3 CoreLocation 0x3436f804 OnClientEvent + 16
4 CoreLocation 0x3436b522 CLClientInvokeCallback(__CLClient*, CLClientEvent, __CFDictionary const*) + 42
5 CoreLocation 0x3436d3cc CLClientHandleDaemonDataLocation(__CLClient*, CLClientLocation const*, __CFDictionary const*) + 196
6 CoreLocation 0x3436d512 CLClientHandleDaemonData(__CFMessagePort*, long, __CFData const*, void*) + 286
7 CoreFoundation 0x33a813fe __CFMessagePortPerform + 242
8 CoreFoundation 0x33a556f8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
9 CoreFoundation 0x33a556bc __CFRunLoopDoSource1 + 160
10 CoreFoundation 0x33a47f76 __CFRunLoopRun + 514
11 CoreFoundation 0x33a47c80 CFRunLoopRunSpecific + 224
12 CoreFoundation 0x33a47b88 CFRunLoopRunInMode + 52
13 GraphicsServices 0x33b0e4a4 GSEventRunModal + 108
14 GraphicsServices 0x33b0e550 GSEventRun + 56
15 UIKit 0x32099322 -[UIApplication _run] + 406
16 UIKit 0x32096e8c UIApplicationMain + 664
17 MyApp 0x00002762 0x1000 + 5986
18 MyApp 0x00002720 0x1000 + 5920
On a device running ios 5 my app works great, but on a device running ios 4.2.1 i get this crash.
The strange thing is that the device crash only when NOT connected to xcode.
When run from xcode it work but when i run it without xcode the app is working till the moment i call the method:
- (void)startLocationUpdates
{
self.locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;
self.locationManager.distanceFilter = 1;
self.locationManager.delegate = self;
[self.locationManager startUpdatingLocation];
}
CRASH LOG:
OS Version: iPhone OS 4.2.1 (8C148)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x3830000f
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x33479462 objc_msgSend + 14
1 CoreLocation 0x34371430 -[CLLocationManager onClientEventLocation:] + 560
2 CoreLocation 0x3436f68e -[CLLocationManager onClientEvent:supportInfo:] + 98
3 CoreLocation 0x3436f804 OnClientEvent + 16
4 CoreLocation 0x3436b522 CLClientInvokeCallback(__CLClient*, CLClientEvent, __CFDictionary const*) + 42
5 CoreLocation 0x3436d3cc CLClientHandleDaemonDataLocation(__CLClient*, CLClientLocation const*, __CFDictionary const*) + 196
6 CoreLocation 0x3436d512 CLClientHandleDaemonData(__CFMessagePort*, long, __CFData const*, void*) + 286
7 CoreFoundation 0x33a813fe __CFMessagePortPerform + 242
8 CoreFoundation 0x33a556f8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
9 CoreFoundation 0x33a556bc __CFRunLoopDoSource1 + 160
10 CoreFoundation 0x33a47f76 __CFRunLoopRun + 514
11 CoreFoundation 0x33a47c80 CFRunLoopRunSpecific + 224
12 CoreFoundation 0x33a47b88 CFRunLoopRunInMode + 52
13 GraphicsServices 0x33b0e4a4 GSEventRunModal + 108
14 GraphicsServices 0x33b0e550 GSEventRun + 56
15 UIKit 0x32099322 -[UIApplication _run] + 406
16 UIKit 0x32096e8c UIApplicationMain + 664
17 MyApp 0x00002762 0x1000 + 5986
18 MyApp 0x00002720 0x1000 + 5920
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您确定
self
在您使用它时一直处于活动状态,并且在销毁self
之前设置了self.locationManager.delegate = nil;
吗?Are you sure that
self
is living all the time you use it and you setself.locationManager.delegate = nil;
before you destroyself
?如果您在将设备包含在配置文件中之后对其进行了维修,则可能会发生这种情况(至少在 xcode 4.2 上)。
首先,检查您手机的“名称”是否与您的个人资料中的“名称”匹配(上次在 xcode 中更新时)。
检查您的设备是否以与 Xcode 相同的“名称”列出(在您的配置文件中)阅读它,
我解决了我的问题,方法
,您可以从配置文件(位于developer.apple.com)中禁用(类似于删除)该设备,然后重新开始,就像使用“新”设备一样。但苹果对开发人员的行为非常挑剔,我不会到处删除和重新创建设备,因为他们可能会开始对您的审批进行人为干扰,这会耗尽您的时间。
清除你的钥匙串,特别是如果你发现像
com.apple.kerberos.kdc com.apple.systemdefault
这样的东西可能是另一种解决方案,特别是如果 XCODE 自行崩溃(Xcode 有时会因为以下原因崩溃)钥匙扣垃圾)。最后的手段,重新安装 xcode (你知道苹果,如果它不起作用并且删除首选项不能解决问题,请重新安装它)。
if you have had your device serviced AFTER it was included in your provisioning profile, this MIGHT happen (at least on xcode 4.2).
first, check to see if your phone's "name" matches the "name" in your profile (when last updated in xcode).
check to see if your device is listed (in your provisioning profile) with the same "name" that Xcode reads on it
i solved my problem by
alternatively, you could disable (sorta like delete) the device from your provisioning profiles (in developer.apple.com) and then starting all over, like with a "new" device. but apple is real picky about developer behavior, i wouldnt go around deleting and recreating devices because they might start doing human interference on your approvals and that will eat up your clock.
clearing your keychain, especially if you find things like
com.apple.kerberos.kdc com.apple.systemdefault
might be an other solution, espec ially if XCODE IS CRASHING ON ITS OWN (Xcode sometimes crashes because of keychain trash).last resort, reinstall xcode (you know apple, if it aint working and deleting preferences doesnt solve it, reinstall it).