iOS 6和位置服务无法正常工作

Sam*_*mui 7 core-location cllocationmanager ios6

我已将我更新iOS SDK到版本6.之后我编译了我的应用程序(工作正常iOS 4 & iOS 5)但现在位置服务不起作用.我delegate没有收到任何更新,上面的位置箭头没有出现......我正在以通常的方式启动服务:

[locationManager startUpdatingLocation];
Run Code Online (Sandbox Code Playgroud)

我的项目是非ARC.

怎么了?这真让我抓狂...

提前致谢.

off*_*fex 6

确保项目的.plist文件中有CFBundleDisplayName.添加该键为我修复了它.


小智 6

只需将pausesLocationUpdatesAutomatically位置管理器的属性设置为NO.这是IOS 6的一项新功能,可在应用程序在后台运行时禁用位置更新.此属性的默认值为YES.


Rol*_*nge 4

这是iOS6的一个变化:

您需要实现locationManager:didUpdateLocations:而不是 locationManager:didUpdateToLocation:fromLocation 以便在位置更新时收到通知。

您还应该阅读有关startUpdatingLocation的文档。