when to use “willChangeValueForKey” and “didChangeValueForKey”?

前端 未结 8 827
我在风中等你
我在风中等你 2021-01-30 10:53

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

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


        
8条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-30 11:44

    if you rewrite property getter methods, please use it.

    @property (assign, nonatomic, getter=isLogined) BOOL logined;
    

提交回复
热议问题