ios - App crashes on only iPhone 5 when adding GMSMarker to the map: EXC_BAD_ACCESS -


the app i'm working on plots lot of gmsmarkers on google map. works fine in other devices, except iphone 5. have subclassed gmsmarker , set object id subclass. done can add markers nsset , ensure there distinct markers plotted , no duplicates. subclass is:

@implementation byomarker -(bool)isequal:(id)object {     byomarker *othermarker = (byomarker *)object;     if (self.objectid.intvalue == othermarker.objectid.intvalue) {         return yes;     }     return no; } -(nsuinteger)hash {     return  [self.objectid hash]; } @end 

the .h file

#import <googlemaps/googlemaps.h>  @interface byomarker : gmsmarker @property (assign, nonatomic) nsnumber  *objectid; @end 

the app crashing @ return of hash function exc_bad_access exception. enabled zombie objects , tried print po marker.objectid when i'm setting map object marker , following error:

*** -[cfnumber respondstoselector:]: message sent deallocated instance 0x80416470 0x80416470 

any help?! tia

you have memory management problem objectid property. don't use assign object pointer properties. use strong.

@property (strong, nonatomic) nsnumber *objectid; 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -