나는 단순한 것으로 생각했을 때 매우 이상한 오류가 나타납니다.목표 C - 오류 : '예상 유형'
#import <Foundation/Foundation.h>
#import "ViewController.h"
#import "GameObject.h"
@interface GameController : NSObject
@property (strong) GLKBaseEffect * effect;
@property (strong) NSMutableArray * gameObjects;
@property (strong) NSMutableArray * objectsToRemove;
@property (strong) NSMutableArray * objectsToAdd;
+ (GameController *) sharedGameController;
- (void) tick:(float)dt;
- (void) initializeGame: (ViewController*) viewcontroller;//ERROR: EXPECTED A TYPE
- (void) createObject:(Class) objecttype atPoint:(CGPoint)position;
- (void) deleteObject:(GameObject*) object atPoint:(CGPoint)position;
- (void) manageObjects;
@end
'ViewController'가 유형인지 여부에 대해 질문하는 이유는 무엇입니까? 그것은 올바르게 구현 한 클래스입니다. 그것은 또한 수입되었습니다. 도움이된다면 편집 *
다음은 ViewController.m 클래스입니다.
#import "ViewController.h"
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[[GameController sharedGameController] initializeGame:self];
}
@end
편집 2
**
과 ViewController.h
#import <GLKit/GLKit.h>
#import "GameController.h"
@interface ViewController : GLKViewController
@end
어떻게'ViewController'가 정의 되었습니까? – Wain
이것으로 도움이 될 것입니다. 비슷한 질문 : http://stackoverflow.com/a/9607607/1422070 – edwardmp
.h 파일 내부에 클래스 이름의 철자가 잘못 표시되었을 수 있습니다. –