问题
Since the depreciation of initCircularRegionWithCenter:radius:identifier:
, how would you define the region to be monitored using CLLocationManager
?
回答1:
Since CLCircularRegion
is a subclass of CLRegion
, you can just cast the instance.
CLCircularRegion *region = [[CLCircularRegion alloc] initWithCenter:theCenter
radius:theRadius
identifier:theIdentifier];
// Then cast the instance for use with your CLLocationManager instance
[manager startMonitoringForRegion:(CLRegion *)region];
来源:https://stackoverflow.com/questions/19205210/how-do-you-use-clregion-in-ios-7-since-initcircularregionwithcenterradiusident