In my iOS5 app, I have NSObject
States
class, and trying to init it:
states = [states init];
here is init
If you are getting this error while trying to use Swift class or method in Objective C: you forgot one of 2 steps Apple defined on this diagram:
Example:
Error shows up in your Test.m
file:
Receiver 'MyClass' for class message is a forward declaration
Step 1: check that Test.h
has
@class MyClass;
Step 2: find *-Swift.h
file name in Build Settings (look for Objective-C Generated Interface Header Name). Name will be something like MyModule-Swift.h
Step 3: check that Test.m
imports the above header
#import "MyModule-Swift.h"