2014-09-22 48 views
0

我有一个头文件ApiManager.h使用枚举,其中我定义一个枚举:在目标C的方法参数

typedef enum ApiEndpoint { 
    // some values 
} ApiEndpoint; 

在该文件中,我有取这些值作为参数之一的方法:

- (NSString *) getPathForEndpoint: (ApiEndpoint) endpoint; 

而这似乎是XCode罚款。在另一个文件,但是,ApiManagerDelegate.h,我有以下定义:

- (void) requestToEndpoint: (ApiEndpoint) endpoint succeeded: (id) responseObject; 
- (void) requestToEndpoint: (ApiEndpoint) endpoint failed: (NSError *) error; 

和XCode的标志双方的ApiEndpoint论点错误expected a type。我已导入ApiManager.h,因此ApiEndpoint会显示在完成列表中,但由于某种原因,XCode无法识别它。

我在做什么错?

+0

我建议使用typedef NS_ENUM(NSInteger,UITableViewCellStyle)宏来定义您的枚举。 – singingAtom 2014-09-22 21:11:13

回答

0

正如@trojanfoe指出的那样,它看起来像循环依赖是问题,他已经神秘地删除了他的答案。

typedef移动到单独的文件ApiEndpoint.h解决了问题。