iOS: How do I know if a property is KVO-compliant?

Short answer: No. Long answer: Nothing in UIKit is guaranteed to be KVO-compliant. If you happen to find that KVO-ing a property works, be grateful, it’s unintentional. Also: be wary. It could very well break in the future. If you find that this is something you need, please file an enhancement request. About your actual … Read more

How can I do Key Value Observing and get a KVO callback on a UIView’s frame?

There are usually notifications or other observable events where KVO isn’t supported. Even though the docs says ‘no’, it is ostensibly safe to observe the CALayer backing the UIView. Observing the CALayer works in practice because of its extensive use of KVO and proper accessors (instead of ivar manipulation). It’s not guaranteed to work going … Read more

Observing an NSMutableArray for insertion/removal

But shouldn’t the synthesized accessors automatically return such a proxy object? No. What’s the proper way to work around this–should I write a custom accessor that just invokes [super mutableArrayValueForKey…]? No. Implement the array accessors. When you call these, KVO will post the appropriate notifications automatically. So all you have to do is: [myObject insertObject:newObject … Read more

What’s the best way to communicate between view controllers?

These are good questions, and its great to see that you’re doing this research and seem concerned with learning how to “do it right” instead of just hacking it together. First, I agree with the previous answers which focus on the importance of putting data in model objects when appropriate (per the MVC design pattern). … Read more