【发布时间】:2013-11-24 09:42:58
【问题描述】:
就像 iOS 中的 Location Service Enabling 或 GPS Enabling 一样,我怎样才能启用 Location Service Enabling 来运行应用程序?还有 iOS 中的 Background Refresh Service。这是代码,使用我启用Location Service。
这里发生的事情是:如果我的Location Service 关闭,那么它会显示一个警报视图,如果我点击settings 按钮,它会将我带到设置>>隐私>>位置服务页面。
代码:
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
[locationManager startUpdatingLocation];
有没有像上面的代码那样方便的东西?
【问题讨论】:
-
我不明白你。你想要
locationManager: didUpdateToLocation: fromLocation:这样的东西吗?
标签: ios objective-c cllocationmanager