One Quickie


Minimal KVC accessors for arrays (Bindings->General)
For an attribute named "layers", here are the KVC accessors to write to let observers react to object addition and removal:
- (NSArray *) layers
{
    return (layers);
} // layers


- (void) insertObject: (id) obj
      inLayersAtIndex: (unsigned) index
{
    [layers insertObject: obj  atIndex: index];
} // insertObjectInLayers


- (void) removeObjectFromLayersAtIndex: (unsigned) index
{
    [layers removeObjectAtIndex: index];
} // removeObjectFromLayersAtIndex



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com