when to use "willChangeValueForKey" and "didChangeValueForKey"?

Posted by Frost Li on Stack Overflow See other posts from Stack Overflow or by Frost Li
Published on 2010-06-10T20:28:49Z Indexed on 2010/06/10 21:02 UTC
Read the original article Hit count: 158

Filed under:
|

I saw these lines in a demo project, but I couldn't understand why it did that.

[self willChangeValueForKey:@"names"];
[self didChangeValueForKey:@"names"];

It called didChangeValueForKey immediately after willChangeeValueForKey. Does it make any sense?

Furthermore, when should be the right time to call this two methods? Thanks a lot!! :)

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about mac