Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios7 既然initCircularRegionWithCenter:radius:identifier:已被弃用,您如何在iOS 7中使用CLRegion?_Ios7_Cllocationmanager_Clregion - Fatal编程技术网

Ios7 既然initCircularRegionWithCenter:radius:identifier:已被弃用,您如何在iOS 7中使用CLRegion?

Ios7 既然initCircularRegionWithCenter:radius:identifier:已被弃用,您如何在iOS 7中使用CLRegion?,ios7,cllocationmanager,clregion,Ios7,Cllocationmanager,Clregion,由于initcircularregion的折旧中心:半径:标识符:,您如何使用CLLocationManager定义要监视的区域?由于CLCircularRegion是CLRegion的子类,您可以强制转换实例 CLCircularRegion *region = [[CLCircularRegion alloc] initWithCenter:theCenter radiu

由于
initcircularregion的折旧中心:半径:标识符:
,您如何使用
CLLocationManager
定义要监视的区域?

由于
CLCircularRegion
CLRegion
的子类,您可以强制转换实例

CLCircularRegion *region = [[CLCircularRegion alloc] initWithCenter:theCenter
                                                             radius:theRadius
                                                         identifier:theIdentifier];

// Then cast the instance for use with your CLLocationManager instance
[manager startMonitoringForRegion:(CLRegion *)region];

你知道他们的最大推荐半径是多少吗?我会坚持半径在1到400米之间,除非苹果公司更新他们的文档另有说明。CLCircularRegion继承自CLRegion,所以我认为不需要强制转换。但除此之外,我同意:通过使用初始值设定项创建CLCircularRegion子类并使用它代替CLRegion,来替换不推荐使用的方法。