iPhone只有在设备未连接到xcode时才会崩溃,如何理解崩溃日志?

标签 iphone xcode crash-log

在运行 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

最佳答案

您确定self在您使用它并设置时一直活着self.locationManager.delegate = nil;在你摧毁之前self

关于iPhone只有在设备未连接到xcode时才会崩溃,如何理解崩溃日志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8251429/

相关文章:

ios - 在 iOS Swift 中单击按钮时向 UITableView 添加一个项目

iphone - iOS - 如何使用用户名和密码获取 twitter OAuthtoken

ios - 该应用程序没有有效的签名 Xcode 7.3

ios - 在不连接到 Xcode 的情况下在设备上模拟 GPX 文件

cocoa - 帮助查看崩溃日志

iphone - 带地址的 MKMapView

iphone - 数组中 uibutton 文本的打乱值

iphone - 即使单击更新按钮后,分发配置文件仍然过期

java - 如何设置jvm崩溃日志文件的位置

iOS:这些地址在 iOS 崩溃日志堆栈跟踪中意味着什么?