Re: How does NSArray/ObjectController add: method work?
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