Unknown class 'RandomController', using 'NSObject' instead


#1

Hi,

I’m learning COCOA, and have a problem with the Charper 2 example: RandomController.

1.- RandomController Class has been created (File+New+File, OS X - Source, Cocoa Class) as subclass of NSObject.
2.- RandomController instance inside MainMenu.xib, created (buttons and label), and class assigned to RandomController.
3.- Links between buttons, label and seed, generate and textField, done. (I can see inside the Connections Inspector and with right button over RandomController object)
4.- RandomController.h and RandomController.m coded.
Writing code for RandomController.h, NSObject and NSTextField, remain in black color (in your code download (that runs OK), its color is magenta, a keyword recognized by the editor, and a listbox appears to select the word).
In your code, little circles with central point (it means linked) appears left line codes of:
IBOutlet NSTextField *textField;
- (IBAction)seed:(id)sender;
- (IBAction)generate:(id)sender;
In my code, I only have little circles with central point left:
- (IBAction)seed:(id)sender;
- (IBAction)generate:(id)sender;

And after built I have this message:
[2010:303] Unknown class ‘RandomController’, using ‘NSObject’ instead. Encountered in Interface Builder file at path /Users/amable/Library/Developer/Xcode/DerivedData/MiRandom_2-ecnbiwhkkjtvkpdlixahtjnrdqbo/Build/Products/Debug/MiRandom_2.app/Contents/Resources/en.lproj/MainMenu.nib.
[2010:303] Could not connect the action seed: to target of class NSObject
[2010:303] Could not connect the action generate: to target of class NSObject

Build finish ok, when I press buttons nothing is done.
Breakpoints inside RandomController.m are not activated.

Please, What I must to do in order to NSObject can be recognized in RandomController.h?
I’m working with last Xcode distribution 6.0.1.

Here you can see my RandomController.h code:

#import <Foundation/Foundation.h>

@interface RandomController : NSObject {
IBOutlet NSTextField *textField;
}

  • (IBAction)seed:(id)sender;
  • (IBAction)generate:(id)sender;

@end