KVO Notifications for a Modification of an NSArray backed by a NSMutableArray
问题 I am trying to use KVO to listen to collection change events on an NSArray property. Publicly, the property is a readonly NSArray, but is backed by an NSMutableArray ivar so that I can modify the collection. I know I can set the property to a new value to get a “set” change, but I’m interested in add, remove, replace changes. How do I correctly notify these type of changes for an NSArray? @interface Model : NSObject @property (nonatomic, readonly) NSArray *items; @end @implementation Model {