|
|
<div id="cnblogs_post_body"> 在ios5.x中springboard 默认定位有所改变,一般情况下好像是不开启的,需要手工调用私有api
来开启执行。以使用百度地图的sdk为例,我们首先要打开系统自带的定位,才能使用定位功能。
<div class="cnblogs_code">1 _locationManager = [[CLLocationManager alloc] init];2 _locationManager.delegate = self;3 if (![CLLocationManager locationServicesEnabled ]) {4 [CLLocationManager setLocationServicesEnabled:YES];5 }6 [_locationManager startUpdatingLocation];7 [_locationManager startMonitoringSignificantLocationChanges]; |
|