• 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
Re: How does NSArray/ObjectController add: method work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does NSArray/ObjectController add: method work?


  • Subject: Re: How does NSArray/ObjectController add: method work?
  • From: mmalcolm crawford <email@hidden>
  • Date: Sat, 22 Jan 2005 22:42:18 -0800


On Jan 22, 2005, at 9:50 PM, Bob Peterson wrote:
How does add: message get processed by NSArrayController/NSObjectController? It does not seem to send the init message to the instance of the objectClass. My objects just seem to come into existence but I don't know how to initialize them when they are created by the NSArrayController.

I'm not sure why you think they don't get sent -init?
If you do want to customise initialisation (and make customisation dependent on something in the application) you can also subclass the controller and override -newObject:


- newObject
{
    id newObject = [super newObject];
    // customise newObject...
    return newObject;
}

There are a couple of examples at <http://homepage.mac.com/mmalc/CocoaExamples/controllers.html> (including "Filtering Controller").

mmalc


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >How does NSArray/ObjectController add: method work? (From: Bob Peterson <email@hidden>)

  • Prev by Date: Re: TableView cell with image?
  • Next by Date: Replace All Return Characters in NSString
  • Previous by thread: How does NSArray/ObjectController add: method work?
  • Next by thread: Replace All Return Characters in NSString
  • Index(es):
    • Date
    • Thread