Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to implement the indexed array accessors as defined in the <a href="https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/KeyValueCoding/Articles/Compliant.html" rel="nofollow noreferrer">KVC programming guide</a>. Then you must use those accessors to access the array and the KVO triggering will work. You can also call <a href="http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Protocols/NSKeyValueCoding_Protocol/Reference/Reference.html#//apple_ref/occ/instm/NSObject/mutableArrayValueForKey:" rel="nofollow noreferrer">-mutableArrayValueForKey:</a> and use that array to addObject: and such and it will in turn call the accessor methods and the KVO triggering will occur as well. There are also set accessors for use in for NSSets, see <a href="http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/ModelObjects/cdAccessorMethods.html#//apple_ref/doc/uid/TP40002154-SW1" rel="nofollow noreferrer">here</a> and <a href="http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Protocols/NSKeyValueCoding_Protocol/Reference/Reference.html#//apple_ref/occ/instm/NSObject/mutableSetValueForKey:" rel="nofollow noreferrer">here</a>.</p> <p>Example:</p> <pre><code>@interface MyClass : NSObject { NSMutableArray *_orders; } @property(retain) NSMutableArray *orders; - (NSUInteger)countOfOrders; - (id)objectInOrdersAtIndex:(NSUInteger)index; - (void)insertObject:(id)obj inOrdersAtIndex:(NSUInteger)index; - (void)removeObjectFromOrdersAtIndex:(NSUInteger)index; - (void)replaceObjectInOrdersAtIndex:(NSUInteger)index withObject:(id)obj; @end </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload