I'm doing an IOS App with a MKMapView
I use a navigation controller in order to go from the main menu to the mapview and from the mapview with a back button to the main menu again. This works ok!.
But if I drop some annotations on the map and press the back button, the app crashed every time.
In the debug navigator of xcode there is error about:
lldb_unnamed_function1128$$CoreLocation
Also some info from Crashlytics:
0
CoreLocation
CLClientCreateIso6709Notation + 31645
1
libobjc.A.dylib
objc_object::sidetable_release(bool) + 174
2
libobjc.A.dylib
objc_object::sidetable_release(bool) + 174
3
MapKit
std::__1::__vector_base<objc_object* __strong, std::__1::allocator<objc_object* __strong> >::~__vector_base() + 28
4
MapKit
MKQuadTrieNodeFree(MKQuadTrieNode*) + 32
5
MapKit
__38-[MKQuadTrie clearAllItemsPerforming:]_block_invoke + 72
6
MapKit
_breadthFirstApply(MKQuadTrieNode*, MKQuadTrieTraversalDirective ()(MKQuadTrieNode*) block_pointer) + 186
7
MapKit
-[MKQuadTrie clearAllItemsPerforming:] + 166
What is lldb_unnamed_function1128$$CoreLocation
error
Can anyone help? :)
My back button code:
- (IBAction)backPressed:(id)sender {
[self.mapView removeAnnotations:self.mapView.annotations];
[self.mapView removeOverlays:self.mapView.overlays];
self.locationManager.delegate = nil;
self.mapView.delegate = nil;
NSLog(@"Done!");
}
viewForAnnotation code:
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation {
if (annotation == mapView.userLocation) {
return nil; // Let map view handle user location annotation
}
// Identifyer for reusing annotationviews
static NSString *annotationIdentifier = @"icon_annotation";
// Check in queue if there is an annotation view we already can use, else create a new one
IconAnnotationView *annotationView = (IconAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:annotationIdentifier];
if (!annotationView) {
annotationView = [[IconAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:annotationIdentifier];
annotationView.canShowCallout = YES;
annotationView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
}
return annotationView;
}
the code that add the annotations (named reload button):
- (IBAction)reload:(id)sender {
[self.mapView removeOverlays:self.mapView.overlays];
if (!userPressedReload) {
self.parkPlace1 = [[Place alloc] initWithLong:40.975301 Lat:22.069451 iconStatus:[NSNumber numberWithInt:2] beforeMin:[NSNumber numberWithInt:10]];
self.parkPlace2 = [[Place alloc] initWithLong:40.981507 Lat:22.057485 iconStatus:[NSNumber numberWithInt:1] beforeMin:[NSNumber numberWithInt:20]];
[self.mapView addAnnotation:self.parkPlace1];
[self.mapView addAnnotation:self.parkPlace2];
userPressedReload = YES;
}
self.annotations = [NSMutableArray arrayWithArray:self.mapView.annotations];
if (self.mapView.userLocation) {
[self.annotations removeObject:self.mapView.userLocation];
}
[self.mapView removeAnnotations:self.annotations];
[self.mapView addAnnotations:self.annotations];
}