我导入了 CoreLocation
,但仍然收到“无已知类方法”错误,而且我也没有在 CLPlacemark.h
中的任何位置看到它的定义。
+ (instancetype)placemarkWithLocation:(CLLocation *)location
name:(NSString *)name
postalAddress:(CNPostalAddress *)postalAddress;
最佳答案
根据文档,
App extensions built with the Intents framework can use this method to create a placemark from existing location and address data. For example, an app that offers a ride service might create a new placemark when resolving a user’s pickup or drop-off location. The returned placemark contains only the data that you provide.
所以你需要导入Intents框架:
@import Intents;
关于objective-c - +CLPlacemark 的 placemarkWithLocation 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42636461/