Using accessors seems to be the way to get KVO notifications on collection objects, but this doesn't appear to work on the childViewControllers NSArray property of a UIViewController. I want to be notified when an object is added or removed to this property. So I tried this:
[self addObserver:self forKeyPath:@"childViewControllers" options:NSKeyValueObservingOptionNew context:nil];
-(NSUInteger)countOfChildViewControllers
{
return self.childViewControllers.count;
}
But I'm not sure if I'm doing it right, I'm not getting any notifications. Is what I want possible?