I saw these lines in a demo project, but I couldn\'t understand why it did that.
[self willChangeValueForKey:@\"names\"];
[self didChangeValueForKey:@\"names\"];
Agree with Barry. I just meet the same problem. Here is a case of using those two methods. I declared a readonly property. So I can't use the property's accessor to change the value.
@property (nonatomic, readonly) BOOL var;
When I want to change the "var", I need to call these two methods manually. Otherwise, observers won't get notified.
self willChangeValueForKey:@"var"];
var = YES;
[self didChangeValueForKey:@"var"];