笔记篇 之 “我的位置(强制获取)”
2017-02-11 本文已影响9人
失忆的程序员
MKMapItem*mylocation = [MKMapItemmapItemForCurrentLocation];
// 当前经纬度
floatcurrentLatitude = mylocation.placemark.location.coordinate.latitude;
floatcurrentLongitude = mylocation.placemark.location.coordinate.longitude;
// 默认位置(模拟器测试要注释掉才行)
[selfsetMapViewCenter:CLLocationCoordinate2DMake(currentLatitude, currentLongitude)];