Re: .. Newbie: KVO question
Re: .. Newbie: KVO question
- Subject: Re: .. Newbie: KVO question
- From: joe OneNinetyTwo <email@hidden>
- Date: Mon, 14 Aug 2006 01:09:36 -0700 (PDT)
not sure if this helps, but I had a similar sounding
problem using bindings and NSArrayController when I
set the content outlet of NSArrayController with a
control drag to the model object instance in the nib,
instead of setting the contentArray binding for the
NSArrayController to File's Owner (MyDocument), which
contained the Model NSArray.
--- Peter Sampson <email@hidden> wrote:
> 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
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
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