iOS   发布时间:2022-03-30  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了ios – 语义问题 – 函数的隐式声明大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用Appirater( https://github.com/arashpayan/appirater)在我的xcode项目中启用应用程序评级.使用“iOS模拟器”时,一切都建立正常,但当我使用“iOS设备”目标存档我的项目时,我得到2个构建错误

语义问题:函数’SYstem_VERSION_GREATER_THAN_OR_EQUAL_TO’的隐式声明在C99中无效

语义问题:函数’SYstem_VERSION_LESS_THAN’的隐式声明在C99中无效

相关的代码行位于Appirater.m文件中:

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?发现了一组非常类似的宏

任何援助将不胜感激.

解决方法

链接中的这些行添加到.pch文件中.清洁和建造.它应该消失.

#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,请注明来意。
标签: