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無法識別它。
我在做什麼錯?
我建議使用typedef NS_ENUM(NSInteger,UITableViewCellStyle)宏來定義您的枚舉。 – singingAtom 2014-09-22 21:11:13