In my iOS5 app, I have NSObject
States
class, and trying to init it:
states = [states init];
here is init
I was trying to use @class "Myclass.h"
.
When I changed it to #import "Myclass.h"
, it worked fine.
You are using
States states;
where as you should use
States *states;
Your init method should be like this
-(id)init {
if( (self = [super init]) ) {
pickedGlasses = 0;
}
return self;
}
Now finally when you are going to create an object for States class you should do it like this.
State *states = [[States alloc] init];
I am not saying this is the best way of doing this. But it may help you understand the very basic use of initializing objects.
Check if you imported the header files of classes that are throwing this error.