No visible @interface


#1

Using Xcode 4.6 and entering the code on page 118 in Chapter 7, I get the following error when I compile:

[quote]No visible @interface for ‘KvcFunAppDelegate’ declares the selector ‘setValue:forkey:’
[/quote]
on the line:

[self setValue:[NSNumber numberWithInt:5] forkey:@"fido"];
At this point in the project there’s not a lot of code, and I can’t see that I’ve entered anything incorrectly.

- (id)init { self = [super init]; if (self) { [self setValue:[NSNumber numberWithInt:5] forkey:@"fido"]; NSNumber *n = [self valueForKey:@"fido"]; NSLog(@"fido = %@", n); } return self; }
Is this a new error in new versions of Xcode or am I just getting blind in my old age?

And yes, I’ve declared fido as an int in the .h file as directed on the same page:

@interface KvcFunAppDelegate : NSObject <NSApplicationDelegate> { int fido; }
Any help is appreciated.


#2

You’re using forkey instead of forKey with a capital K.