• 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
KVO autonotifying complaining about custom setter return value
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVO autonotifying complaining about custom setter return value


  • Subject: KVO autonotifying complaining about custom setter return value
  • From: "Jim Turner" <email@hidden>
  • Date: Tue, 4 Mar 2008 10:49:55 -0600

Hi List,

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:]

The setter is returning void and both setter and getter are working as
expected, so I'm not sure where this is coming from.  My object looks
like this:

@interface MyObject : MyObjectSuper
{
	id value;
}

@property (assign, setter=setValueForBindings:) id value;
-(void) setValueForBindings:(id)_value;

@end

@implementation MyObject

@dynamic value;

- (id) value
{
	return( value );
}

-(void) setValueForBindings:(id)_value
{
	[self willChangeValueForKey:@"value"];
	{
		BOOL didSetOK = [self setStringValue:(NSString *)_value];
                // Do something with didSetOK
	}
	[self didChangeValueForKey:@"value"];
}
@end


>From what I can tell from the documentation, this is all perfectly
valid.  I even tried removing the method that returns a value inside
the setter to see if that was the problem and it didn't change
anything.  Is this a bug or am I just missing something?

Thanks

--
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: "Kyle Sluder" <email@hidden>
  • Prev by Date: Re: Tabless NSTabView IB3 Bug
  • Next by Date: Re: Tabless NSTabView IB3 Bug
  • Previous by thread: Re: Tabless NSTabView IB3 Bug
  • Next by thread: Re: KVO autonotifying complaining about custom setter return value
  • Index(es):
    • Date
    • Thread