Question on insertObject: in<Key>AtIndex
Question on insertObject: in<Key>AtIndex
- Subject: Question on insertObject: in<Key>AtIndex
- From: Phillip Hall <email@hidden>
- Date: Sun, 01 Feb 2009 16:35:03 +1100
I have the following setup
1 custom model class (Vegetable)
1 class (AppController) Has an NSMutableArray (vegetables) property.
1 NSArrayController. Object controller set to Class with Class name
set to Vegetable. Content Array is bound to AppController.vegetables
I have a button on my window which is bound to the NSArrayControllers
add: action.
Now I want to know the different ways to know when the an object is
added to the vegetables array via the NSArrayControllers add: action.
First i Iooked registering an observer on the AppControllers key path
"vegetable". This worked fine.
I then read about the insertObject: in<Key>AtIndex: method. Reading
the documentation it seems this should be called by the
NSArrayController if its implemented by its content array (in my case
AppController).
I have implemented the method, but it does not get called. I
obviously have the wrong end of the stick on how insertObject:
in<Key>AtIndex: is supposed to be used.
Can anyone see where I have gone wrong?
Thanks -
Phillip Hall
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden