.. Newbie: KVO question
.. Newbie: KVO question
- Subject: .. Newbie: KVO question
- From: Peter Sampson <email@hidden>
- Date: Sun, 13 Aug 2006 21:12:05 -1000
Hello,
I have a model class, Book.
I want to set the "title" property of that class on insertion, with a
default value.
Created everything to be KVO compliant, no problems until I try to
setValue: forKey: on add: (via NSArrayController.
Here's what I did:
- correctly set accessor methods;
- 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;
}
Message gets sent, and NSLog prints. However, I get this error:
setValue:forUndefinedKey:]: this class is not key value coding-
compliant for the key title.
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.
Any ideas?
Thanks -- very much.
Peter
_______________________________________________
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