objective c - only for IOS 9, MKPlacemark initWithCoordinate:]: unrecognized selector -


only ios 9

-(void)getroutedirections{ mkdirectionsrequest *request = [[mkdirectionsrequest alloc] init]; [request setsource:[mkmapitem mapitemforcurrentlocation]]; 

crash line:

mkplacemark * placemark = [[mkplacemark alloc]initwithcoordinate:_location.coordinate]; } 

exception:

-[mkplacemark initwithcoordinate:]: unrecognized selector sent instance

answer larme comments:

- (instancetype)initwithcoordinate:(cllocationcoordinate2d)coordinate; available since ios10.

for ios 9 or earlier, initwithcoordinate:addressdictionary: available since ios 3.


Comments

Popular posts from this blog

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -