• 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: "Kyle Sluder" <email@hidden>
  • Date: Tue, 4 Mar 2008 22:10:04 -0500

On Tue, Mar 4, 2008 at 11:49 AM, Jim Turner <email@hidden> wrote:
>  In attempting to use a custom setter for a object, I'm getting the
>  following message in the console the first time that object is
>  instantiated:
>
>  KVO autonotifying only supports -set<Key>: methods that return void.
>  Autonotifying will not be done for invocations of -[MyObject
>  setValue:]
>
>  [snip]
>
>  -(void) setValueForBindings:(id)_value
>  {
>         [self willChangeValueForKey:@"value"];
>         {
>                 BOOL didSetOK = [self setStringValue:(NSString *)_value];
>                 // Do something with didSetOK
>         }
>         [self didChangeValueForKey:@"value"];
>  }

Please re-read the second sentence of that error again.  You are
manually invoking -willChangeValueForKey: and -didChangeValueForKey:
and KVO is complaining "I've already done that!".  Either stop doing
that, or implement -automaticallyNotifiesObserversForKey: to return NO
for the "bindings" key.

--Kyle Sluder
_______________________________________________

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: Chris Suter <email@hidden>
References: 
 >KVO autonotifying complaining about custom setter return value (From: "Jim Turner" <email@hidden>)

  • Prev by Date: Re: Triggering GUI login session from daemon? And reboot.
  • Next by Date: Re: Panel in framework
  • Previous by thread: KVO autonotifying complaining about custom setter return value
  • Next by thread: Re: KVO autonotifying complaining about custom setter return value
  • Index(es):
    • Date
    • Thread