'CGPoint'之前的预期说明符 - 限定符列表

时间:2010-05-20 14:26:28

标签: objective-c unit-testing iphone-sdk-3.0

我的项目编译并运行正常,除非我尝试编译我的单元测试包,它在下面用第5行上的“预期说明符 - 资格列表 - 'CGPoint'”错误进行轰炸:

#import <Foundation/Foundation.h>
#import "Force.h"

@interface WorldObject : NSObject {
    CGPoint coordinates;
    float altitude;
    NSMutableDictionary *forces;
}

@property (nonatomic) CGPoint coordinates;
@property (nonatomic) float altitude;
@property (nonatomic,retain) NSMutableDictionary *forces;

- (void)setObject:(id)anObject inForcesForKey:(id)aKey;
- (void)removeObjectFromForcesForKey:(id)aKey;
- (id)objectFromForcesForKey:(id)aKey;
- (void)applyForces;

@end

我已确保我的单元测试包是我的 WorldObject.m 的目标,并且它的标头已导入我的测试标题中:

#define USE_APPLICATION_UNIT_TEST 1

#import <SenTestingKit/SenTestingKit.h>
#import <UIKit/UIKit.h>
#import "Force.h"
#import "WorldObject.h"


@interface LogicTests : SenTestCase {
    Force *myForce;
    WorldObject *myWorldObject;
}

@end

1 个答案:

答案 0 :(得分:9)

您需要在头文件(问题中的顶级文件)中导入<UIKit/UIKit.h>而不是<Foundation/Foundation.h>