Re: KVC not allowing setValue:forKey: on ints
Re: KVC not allowing setValue:forKey: on ints
- Subject: Re: KVC not allowing setValue:forKey: on ints
- From: James Bucanek <email@hidden>
- Date: Sun, 1 Apr 2007 22:39:07 -0700
Ken Tozier wrote on Monday, April 2, 2007:
>- (id) initFoo
>{
> self = [super init];
> if (self)
> {
> [self setValue: 10
> forKey: @"bobo"];
> }
>
> return self;
>}
>
>@end
>
>What am I messing up here?
I would guess two things:
a) setValue:forKeyPath: (not setValue:forKey:)
b) value is an object (id), not an integer. It should be [self setValue:[NSNumber numberWithInt:10] forKeyPath:@"bobo"];
--
James Bucanek
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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