It is my GameEngine.h:
#import <Foundation/Foundation.h>
#import "GameArray.h";
@interface GameEngine : NSObject {
GameArray *gameButtonsArray;
}
@property (nonatomic, retain) GameArray *gameButtonsArray;
And this is my GameArray.h:
#import <Foundation/Foundation.h>
#import "MyAppDelegate.h";
@interface GameArray : NSObject {
NSMutableArray *gameButtonsArray;
}
@property (nonatomic, retain) NSMutableArray *gameButtonsArray;
It keep prompt my "expected specifier-qualifier-list" error i my GameEngine.h, and error said that "expected specifier-qualifier-list before 'GameArray'", what's going on?
Lose the semi-colon on line 2 in your
.h
fileIf removing the unnecessary semicolons does not fix your problem, most likely MyAppDelegate.h imports GameEngine.h creating a circular dependency between the GameEngine.h and GameArray.h. Try removing the
#import "GameArray.h"
from GameEngine.h and replacing it with:Also add
to GameEngine.m below the import of GameEngine.h
This is the best practice.
GameEngine.h
Then in GameEngine.m
This prevents circular references wherein one header imports a second header which imports the first which imports the second and so on in an endless cycle.