若MKAnnotation的coordinate的值设置错误会发生下面的类似的异常信息:
An instance 0x5fc5c00 of class Annotation was deallocated while key value observers were still registered with it. Observation info was leaked, and may even become mistakenly attached to some other object. Set a breakpoint on NSKVODeallocateBreak to stop here in the debugger. Here's the current observation info:
<NSKeyValueObservationInfo 0x5fbc560> (
<NSKeyValueObservance 0x5fbc400: Observer: 0x6bf6840, Key path: coordinate, Options: <New: NO, Old: NO, Prior: YES> Context: 0x0, Property: 0x5fbbd60>
)
float longtitude = [[coordinateArr objectAtIndex:0] floatValue]; // -180 < latitude < 180
float latitude = [[coordinateArr objectAtIndex:1] floatValue]; // -90 < longtitude < 90
Annotation *anno = [[Annotation alloc] init];
anno.coordinate = CLLocationCoordinate2DMake(latitude, longtitude);