CLLocationManager.monitoredRegions should be KVO compliant
| Originator: | victor.jalencas | ||
| Number: | rdar://11847279 | Date Originated: | 2012-07-11 |
| Status: | Open | Resolved: | |
| Product: | iPhone SDK | Product Version: | 5.1 |
| Classification: | Enhancement | Reproducible: | Always |
Summary: The monitoredRegions of the CLLocationManager instances is not KVO compliant. Steps to Reproduce: 1- Obtain a CLLocationManager instance 2- Add an observer for the key path @"monitoredRegions". If you specify the NSKeyValueObservingOptionInitial is specified as an option, we get a call to the KVO method in the observer. 3- start monitoring a new region on the location manager, or stop monitoring one of the regions. Expected Results: More calls to the KVO method observeValueForKeyPath:ofObject:change:context: as regions are added and removed from the set. Actual Results: No calls to the KVO method. Regression: [redacted] Notes: When adding a new region to monitor to a location manager, it may decide that there's too many regions and not honor the request. In principle, such changes are communicated to the delegate, but the monitored regions are shared amongst any location manager instances, so the delegate methods are not necessarily called for all region changes. Thus, we need some way to detect when regions are added and removed. If the monitoredRegions property was KVO compliant, we'd be able to react to these changes and, for example, update a map view with the actual regions being monitored - and not with what the application thinks it is being monitored.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!