简体   繁体   中英

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MKUserLocation annotationType]: unrecognized selector

i am receiving this error when trying to add user location. I have a table view and when i try to scroll, i receive this error. I'm very new to xcode.

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MKUserLocation annotationType]: unrecognized selector sent to instance 0x803f090'

Any help is much appreciated.

MKUserLocation does not have an annotationType method. You're sending MKUserLocation a message that it does not know how to handle.

I am encountered this before, it is normally because of simple & not obvious type of mistake ie format wrong - didn't call a function based on the unexpected format, type wrong.

I used:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ABC:) ....name:@"UIDeviceBatteryLevelDidChangeNotification" object:nil];

The "ABC" function, I declared not based on the expected function format.

Instead of:

- (void) ABC:(NSNotification *)notification 

I used:

- (NSString *)DDD 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM