美文网首页SO 问题来了
笔记篇 之 “我的位置(强制获取)”

笔记篇 之 “我的位置(强制获取)”

作者: 失忆的程序员 | 来源:发表于2017-02-11 10:20 被阅读9次

MKMapItem*mylocation = [MKMapItemmapItemForCurrentLocation];

// 当前经纬度

floatcurrentLatitude = mylocation.placemark.location.coordinate.latitude;

floatcurrentLongitude = mylocation.placemark.location.coordinate.longitude;

// 默认位置(模拟器测试要注释掉才行)

[selfsetMapViewCenter:CLLocationCoordinate2DMake(currentLatitude, currentLongitude)];

相关文章

网友评论

    本文标题:笔记篇 之 “我的位置(强制获取)”

    本文链接:https://www.haomeiwen.com/subject/glanittx.html