I’m very new to Objective-C, so this is probably very basic.
Anyhow, I am trying to specify a custom return type in my class, and I keep getting errors that the class either needs an asterisk* or is not considered a type at all. I read that you need to use @class instead of #import in your header files, but that doesn’t seem to help in this case. What else am I doing wrong?
Here is my code:
#import <Foundation/Foundation.h>
@class Room;
@interface LevelData : NSObject {
@private
NSArray *data;
Room *currentRoom;
}
+(void)initialize;
+(*Room)getCurrentRoom;
@end
Thanks a bunch!
change that one line to:
and see if that compiles.
Room *indicates you’re returning a pointer to a Room Objective-C object.