• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: KVO autonotifying complaining about custom setter return value
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: KVO autonotifying complaining about custom setter return value
      • From: Adam P Jenkins <email@hidden>
    • Re: KVO autonotifying complaining about custom setter return value
      • From: mmalc crawford <email@hidden>
References: 
 >KVO autonotifying complaining about custom setter return value (From: "Jim Turner" <email@hidden>)
 >Re: KVO autonotifying complaining about custom setter return value (From: "Kyle Sluder" <email@hidden>)
 >Re: KVO autonotifying complaining about custom setter return value (From: Chris Suter <email@hidden>)
 >Re: KVO autonotifying complaining about custom setter return value (From: "Jim Turner" <email@hidden>)
 >Re: KVO autonotifying complaining about custom setter return value (From: mmalc crawford <email@hidden>)

  • Prev by Date: Re: Core Data, SQLite, and Housekeeping
  • Next by Date: Re: regexkit [Using NSPredicate to parse strings]
  • Previous by thread: Re: KVO autonotifying complaining about custom setter return value
  • Next by thread: Re: KVO autonotifying complaining about custom setter return value
  • Index(es):
    • Date
    • Thread