This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define LIST_OF_ServerAPI \ | |
/*會員*/ \ | |
api(登入, member/login) \ | |
api(FB登入, member/fbLogin) | |
typedef NS_ENUM(NSInteger, ServerAPI) { | |
#define api(key, name) key, | |
LIST_OF_ServerAPI | |
#undef api | |
}; | |
- (void)call { | |
NSString *apiKey; | |
NSString *apiName; | |
switch (api) { | |
#define api(key, name) \ | |
case key: \ | |
apiKey = @#key; \ | |
apiName = @#name; \ | |
break; | |
LIST_OF_ServerAPI | |
#undef api | |
default: | |
NSAssert1(false, @"%@:ServerAPI未實作", NSStringFromSelector(_cmd)); | |
return; | |
} | |
} |
沒有留言:
張貼留言