Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Do not crash when no cluster title is provided. #30

Merged
merged 1 commit into from

2 participants

@alloy

This happens when an annotation was selected (the callout is shown) and the view deallocates. It seems the private MKMapAnnotationManager class still ends up calling this title method, which in my case has no custom title, leading to an exception in +[NSString stringWithFormat].

/cc @jeffkreeftmeijer

@alloy

I did not make this connection before, but it seems this crash is only triggered on iOS 7. After the public release of iOS 7 yesterday, I’ve seen a couple of crash reports relating to this issue come by.

@PatrickNLT PatrickNLT merged commit c8982e5 into applidium:master
@PatrickNLT
Owner

With a little delay… Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 17, 2013
  1. @alloy
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 5 deletions.
  1. +5 −4 ADClusterMapView/ADMapCluster.m
  2. +2 −1  CHANGELOG.md
View
9 ADClusterMapView/ADMapCluster.m
@@ -313,14 +313,15 @@ - (BOOL)isRootClusterForAnnotation:(id<MKAnnotation>)annotation {
- (NSString *)title {
if (!self.annotation) {
- return [NSString stringWithFormat:_clusterTitle, [self numberOfChildren]];
+ if (_clusterTitle) {
+ return [NSString stringWithFormat:_clusterTitle, [self numberOfChildren]];
+ }
} else {
if ([self.annotation.annotation respondsToSelector:@selector(title)]) {
return self.annotation.annotation.title;
- } else {
- return nil;
}
}
+ return nil;
}
- (NSString *)subtitle {
@@ -396,4 +397,4 @@ - (void)_cleanClusters:(NSMutableArray *)clusters outsideMapRect:(MKMapRect)mapR
[clusters removeObjectsInArray:clustersToRemove];
[clustersToRemove release];
}
-@end
+@end
View
3  CHANGELOG.md
@@ -4,6 +4,7 @@ Bugfixes:
- Fix potential crash during animations (@scheinem)
- Fix a bug when an ADClusterAnnotation instance had no cluster assigned in `mapView:viewForAnnotation:`
+ - Fix crash when the view is deallocated and the private `MKMapAnnotationManager` class still tries to update a selected annotation. (@alloy)
Features:
@@ -27,4 +28,4 @@ Bugfixes:
## 1.0.0 (26 October 2012)
-First release
+First release
Something went wrong with that request. Please try again.