开发者

Setting modified flag in a class

Say I have a class Car that has 2 properties:

NSMutableArray *parts and BOOL modified

parts is an array of custom object called Part. I want modified to be set to YES if any property of any Part in the array is modified.

I开发者_C百科s this a good candidate for KVO or is there a better way to do this?


YES ! That's exactly what KVO is made for, and your use case is a typical usage for this :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜