Re: .. Newbie: KVO question
Re: .. Newbie: KVO question
- Subject: Re: .. Newbie: KVO question
- From: mmalc crawford <email@hidden>
- Date: Mon, 14 Aug 2006 08:39:38 -0700
On Aug 14, 2006, at 12:12 AM, Peter Sampson wrote:
- subclass NSArrayController and pointed to the custom class in IB;
- Override add: method as below:
- (void) add:(id)sender {
[super add:sender];
NSLog(@"New Object.");
[self setValue:@"Great Book Title" forKey:@"title"];
return self;
}
'self' is the array controller...
It's not clear why you're returning 'self' from a 'void' method?
See also <http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSObjectController_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObjectController/add:
>
If you want to ensure a default value is set for all new instances
created using the array controller, then override newObject.
I've honestly searched high and low on this, including going through
mmalc's examples. My class doesn't respond to init for some reason,
either.
This is illustrated in "Filtering Controller"
<http://homepage.mac.com/mmalc/CocoaExamples/controllers.html>
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