Application crashes when asking if user wants to u

2019-06-12 16:24发布

I have an iPhone app that is using CoreLocation.

Upon first installing the app, the iPhone system message is displayed asking whether or not the user wants to allow location services, if they click yes, my app suddenly displays the first screen of my app (I'm using a navigation controller), and crashes. This is what I see in the log -

warning: UUID mismatch detected with the loaded library - on disk is:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks/CoreTelephony.framework/CoreTelephony
=uuid-mismatch-with-loaded-file,file="/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks/CoreTelephony.framework/CoreTelephony"
Program received signal:  “EXC_BAD_ACCESS”.

And the stack trace looks like this alt text

My code isn't too far off from the LocateMe sample (which works on my device). I have this:

CLLocationManager *clLocationManager = [[CLLocationManager alloc] init];
clLocationManager.delegate = self;

if (clLocationManager.locationServicesEnabled) {
    [clLocationManager startUpdatingLocation];
} else {
    self.searchBar.placeholder = @"Enter location";
}

Any idea on waht I'm doing wrong?

2条回答
迷人小祖宗
2楼-- · 2019-06-12 16:59

It looks like this is a byproduct of this question

To solve the problem, I wound up following this approach

Basically, in my ViewController's dealloc method -

- (void)dealloc {
locationManager.delegate = nil;
[locationManager release];
}
查看更多
爷的心禁止访问
3楼-- · 2019-06-12 17:00

does your navigation controller support CLLocationManagerDelegate? it looks like it's crashing trying to send you an event.

what does your locationManager:didUpdateToLocation:fromLocation: function look like?

查看更多
登录 后发表回答