Observing the editing property of a UITableViewController
You're confusing Key-Value Coding compliance with Key-Value Observing compliance. The property is KVC-compliant, which means you can use [myViewController valueForKey:@"editing"]
to access it (if you like typing), but this does not mean it is KVO-compliant.
KVO-compliance is achieved by the object either implementing a KVC-compliant setter (bullet points 2 and 3), which KVO will wrap automatically, or manually posting KVO notifications by sending itself will
/didChangeValueForKey:
messages.
UIViewController and UITableViewController do not publicly implement setEditing:
; if they don't implement it at all, then KVO wrapping it automatically is out. That leaves manual notifications. If you're not getting any KVO notifications for the property (and you are actually hitting that addObserver:forKeyPath:options:context:
message), that suggests that those classes neither privately implement setEditing:
nor manually post KVO notifications.
Therefore, the property is not observable.
If the only way anything ever sets the editing
property is by sending the controller a setEditing:animated:
message, then you can override setEditing:animated:
and send the KVO notifications yourself from your implementation, and then the property will be observable.