NSSet containsObject Not Working?
问题 I am trying to check if the annotation exists before adding it to array. I can't figure out why [visibleAnnotations containsObject:annotation] always returns False. MKMapRect mRect = self.locationView.visibleMapRect; NSSet *visibleAnnotations =[self.locationView annotationsInMapRect:mRect]; NSLog(@"Annotation in Rect %@",visibleAnnotations); for(NSArray * obj in JSON){ coordinates.latitude=[[obj valueForKey:@"Latitude"] doubleValue]; coordinates.longitude=[[obj valueForKey:@"Longitude"]