Re: KVO autonotifying complaining about custom setter return value
Re: KVO autonotifying complaining about custom setter return value
- Subject: Re: KVO autonotifying complaining about custom setter return value
- From: "Jim Turner" <email@hidden>
- Date: Wed, 5 Mar 2008 13:40:29 -0600
On Wed, Mar 5, 2008 at 12:00 PM, mmalc crawford <email@hidden> wrote:
>
> On Mar 5, 2008, at 9:34 AM, Jim Turner wrote:
>
> > I filed a bug (rdar://problems/5781977) as this doesn't appear to be
> > proper behavior. I'd be happy to be told I'm wrong if you can point
> > out what I'm missing.
>
> I believe this behaves correctly.
> As stated in <http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_5_section_5.html#
> >, "Key-value coding and declared properties are orthogonal
> technologies."
> KVC doesn't know about any custom setter you may have defined for a
> property.
>
> mmalc
>
>
Hmm, it appears the developer documentation I have locally on my
machine is slightly out of date. After reading that link (and the
updated description of setter= and getter=), I see now why what I'm
doing isn't working. Properties and KVO/KVC aren't complimentary to
each other... although it'd be nice if they were. I'll have to
re-work my object to get it to be properly compliant.
But, I still appear to have an issue with defining a custom
getter/setter. Defining a property as
@property (setter=mySetMethod:,getter=myMethod) id valueTest;
and sending my object a valueTest message, I get the unrecognized
selector sent to instance warning. Reading (and re-reading several
times) http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_5_section_3.html#//apple_ref/doc/uid/TP30001163-CH17-SW17
it appears that I don't need to define anything other than the
@property but unless I also place
-(id) valueTest;
-(void) setValueTest:(id)_value;
in the interface, the object can't find a method signature.
This is a little more confusing that I originally thought. I
appreciate all the help, though.
--
Jim
http://nukethemfromorbit.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden