• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Question on insertObject: in<Key>AtIndex
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Question on insertObject: in<Key>AtIndex
      • From: mmalc Crawford <email@hidden>
  • Prev by Date: Cg Geometry Shader
  • Next by Date: NSXMLParser and Unicode/"Foreign" Character problems
  • Previous by thread: Cg Geometry Shader
  • Next by thread: Re: Question on insertObject: in<Key>AtIndex
  • Index(es):
    • Date
    • Thread