Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminating app due to uncaught exception 'NSRangeException' #42

Open
jmrborges05 opened this issue Jul 28, 2016 · 1 comment
Open

Terminating app due to uncaught exception 'NSRangeException' #42

jmrborges05 opened this issue Jul 28, 2016 · 1 comment

Comments

@jmrborges05
Copy link

When i open the map view the app crash.
i try to check where is the crash, the map view crash before viewDidLoad.
The trace of the error is this:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '-[__NSCFArray objectAtIndex:]: index (0) beyond bounds (0)'

i check in crashlytics to view where is the error and the report is in this file:
TSClusterMapView.m line 36
-[TSClusterMapView initWithCoder:]

There is the code where i put the annotations:

 self.annotations = [PoiAnnotation]()
          for i in 0 ..< self.pois.count {
               if let poi = self.pois.objectAtIndex(i) as? Pois {
                    let marker = Marker.init(
                         title: poi.title, subtitle: String(poi.poi_type_id), latitude: (poi.lat as NSString).doubleValue, longitude: (poi.lng as NSString).doubleValue, poi:poi
                    )
                    annotations.append(marker.annotation)
               }
          }
          if let annotationFilter = self.defaults.objectForKey("annotationFilter") as? [Int] {
               print(annotationFilter)
               self.filterCategoriesbyExistentFilter(annotationFilter)
          }
          self.mapView.addClusteredAnnotations(annotations)

This is only occurred in one device Iphone 5s.
I'm using version 2.10 of the pod.

@ashare80
Copy link
Owner

ashare80 commented Aug 4, 2016

Do you have a full stack trace?

Does this crash happen when you add annotations or during the initialization? If it is during initialization you might have an issue outside the scope of this framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants