ios - startMonitoringForRegion : deprecated

标签 ios cllocationmanager deprecated

CLLLocationManager 中的 header 有这一行:

- (void)startMonitoringForRegion:(CLRegion *)region
             desiredAccuracy:(CLLocationAccuracy)accuracy __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA, __MAC_NA,__IPHONE_4_0, __IPHONE_6_0);

事实上,我的一个应用程序在编译和归档时报告了一个警告。尽管 Apple 文档中仍然包含它,但暗示它不会过时。即使是对该问题的网络搜索也没有返回结果。什么事?对于某些用户,我是否有失去此功能的风险?

最佳答案

苹果 docs说这已被弃用,您应该改用 startMonitoringForRegion:

风险与任何已弃用的方法相同,它最终会被删除,因此最好尽可能将其从您的代码中删除(新方法仅存在于 iOS 6+,因此您仍然需要在 iOS 6+ 中使用旧方法旧版本)

关于ios - startMonitoringForRegion : deprecated,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20406831/

相关文章:

ios - UINavigationController 和 UITabBarController 子类化?

ios - 如何从 PDF 中获取 UIImage

iOS。 CLLocationManager 在 didUpdateLocations 中仅接收一次位置更新

ios - 无法在 UITableViewCell 的详细信息文本中显示阿姆哈拉字母

ios - mailcore2 imap错误域= MCOErrorDomain代码= 5

ios - 如何使用 AVCapturePhoto 包含位置数据?

ios - startMonitoringForRegion 真的有效吗?

c++ - 不赞成从字符串 const 进行转换。到 wchar_t*

java - 如何查找第三方工具的 java 已弃用 api?

android - PushService 类型的 setDefaultPushCallback 方法已弃用 android