In my iOS5 app, I have NSObject
States
class, and trying to init it:
states = [states init];
here is init
method in States
:
- (id) init
{
if ((self = [super init]))
{
pickedGlasses = 0;
}
return self;
}
But there is error in the line states = [states init];
receiver type "States" for instance message is a forward declaration
What does it mean? What am I doing wrong?
That basically means that you need to import the .h file containing the declaration of States.
However, there is a lot of other stuff wrong with your code.
+alloc
'ing it. That won't work[super init]
in -init
.@class
in the header, but never imported the class.