xcode6和ios 8 百度无法定位解决

1. @interface里:
    CLLocationManager *locationManager;
2. 初始化:
    locationManager = [[CLLocationManager alloc] init];
3. 调用请求:
    [locationManager requestAlwaysAuthorization];
    [locationManager startUpdatingLocation];
4. 在 info.plist里加入:
    NSLocationWhenInUseDescription,允许在前台获取GPS的描述
    NSLocationAlwaysUsageDescription,允许在后台获取GPS的描述

 

posted @ 2014-09-23 09:41  菜鸟程序猿  阅读(175)  评论(0编辑  收藏  举报