Here is my header file for Board:
#import "Game.h"
#import <Foundation/Foundation.h>
@interface Board : UIView
{
enum Piece;
}
- (void) setGame: (Game*) theGame; //<-- this is where the error is
typedef enum {X, O, NONE} Piece;
- (float)getSection;
@end
The compiler says “Expected a type” and has (Game*) underlined. What is the problem here?
Game.h:
#import <Foundation/Foundation.h>
#import "Board.h"
@interface Game : UIViewController
- (void)boardwasTapped:(int) row:(int) column;
@end
Don’t import your header, but forward declare it. Import the Game header in Board.m
Also, are you sure the problem isn’t with your enum? You are using it in your header before you declare it. You should declare it above (outside) the @interface block.