大佬教程收集整理的这篇文章主要介绍了ios – 语义问题 – 函数的隐式声明,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
语义问题:函数’SYstem_VERSION_GREATER_THAN_OR_EQUAL_TO’的隐式声明在C99中无效
语义问题:函数’SYstem_VERSION_LESS_THAN’的隐式声明在C99中无效
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]]; }
我在How to check iOS version?发现了一组非常类似的宏
任何援助将不胜感激.
#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)
更多信息:由于预处理器无法找到它们来查找和替换这些宏,因此它们会传递到编译器,它们看起来像C函数.编译器找不到它们并给出错误.
以上是大佬教程为你收集整理的ios – 语义问题 – 函数的隐式声明全部内容,希望文章能够帮你解决ios – 语义问题 – 函数的隐式声明所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。