111*_*110 1 iphone gps objective-c geolocation
我想根据我的地理位置获取城市名称.问题是我在这个方法中从title获得编译时错误.我做错了什么?
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark
{
MKPlacemark * myPlacemark = placemark;
// with the placemark you can now retrieve the city name
NSString *city = [myPlacemark.addressDictionary objectForKey:(NSString*) kABPersonAddressCityKey];
}
Run Code Online (Sandbox Code Playgroud)
Vla*_*mir 11
这个常量来自AddressBook框架,尽管它也在它之外使用.尝试导入AddressBook标头以解决您的问题:
#import <AddressBook/AddressBook.h>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3296 次 |
| 最近记录: |