本文介绍了如何在为设备而不是 iOS 模拟器构建时只包含一个框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
限时送ChatGPT账号..
我们使用的第三方推送通知框架尚未针对 x86_64 进行编译,这意味着每当我们为模拟器构建时,都会收到构建警告.由于我们试图将警告视为错误,因此这是行不通的.
We’re using a third-party push notification framework which has not been compiled for x86_64, which means that whenever we build for the simulator, we get a build warning. Since we’re trying to treat warnings as errors, this won’t do.
我只想在设备上构建时包含这个框架.然后我只会编译在设备上使用它的代码.
I’d like to only include this framework when building on devices. I’ll then only compile the code that uses it on devices too.
可以实现吗?
推荐答案
- 在Build Phases > Link Binary With Libraries 中让你的框架
- 在 Build Settings > Linking 中的Other Linker Flags"中为选项 Any iOS Simulator SDK 创建调试标志并添加值
-ObjC -weak_framework YourFrameworkName代码>. - 并在代码中检查像这样的构建目标
#if TARGET_IPHONE_SIMULATOR.
可选不是必需- Make your framework
optionalnotrequiredin Build Phases > Link Binary With Libraries - In Build Settings > Linking in "Other Linker Flags" create Debug flag for option Any iOS Simulator SDK and add value
-ObjC -weak_framework YourFrameworkName. - And in code check for build target like this
#if TARGET_IPHONE_SIMULATOR.
这篇关于如何在为设备而不是 iOS 模拟器构建时只包含一个框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
The End


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)