Problems:
Semantic Issue: Implicit declaration of function 'SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO' is invalid in C99
Semantic Issue: Implicit declaration of function 'SYSTEM_VERSION_LESS_THAN' is invalid in C99
The relevant lines of code are in the Appirater.m file:
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0") && SYSTEM_VERSION_LESS_THAN(@"7.1")) {
reviewURL = [templateReviewURLiOS7 stringByReplacingOccurrencesOfString:@"APP_ID" withString:[NSString stringWithFormat:@"%@", _appId]];
}
Answers:
Add these lines from your link to your .pch file. Clean and build. It should go away.
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
More info: since the preprocessor cannot find them to do a find and replace for these macros, they pass through to the compiler where they look like C functions. The compiler cannot find them and gives you an error.
参考:http://stackoverflow.com/questions/23818606/semantic-issue-implicit-declaration-of-function
本文介绍了如何解决Objective-C代码中遇到的C99标准下函数隐式声明错误的问题,并提供了相关的宏定义解决方案。通过在预处理器中添加必要的宏定义,可以避免编译器找不到函数的错误。
18万+

被折叠的 条评论
为什么被折叠?



