I am trying to implement the method below to select the set of annotations in the visible region of my map.
- (NSSet *)annotationsInMapRect:(MKMapRect)mapRect
I added the line in my code as such
NSSet *nearbySet = [self annotationsInMapRect:self.mapView.frame];
My app is crashing because of this. Can anyone advise on how I should use the above method correctly?
EDIT:
Stack Trace is as follows:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CarParkTableViewController annotationsInMapRect:]: unrecognized selector sent to instance 0x187b60'
Thanks
Zhen Hoe
Try
Your posted error shows that self is not an instance of MKMapView but annotationsInMapRect is a message you can send only to that class.