如何抑制`警告:链接对dylib不安全,无法在应用程序扩展中使用? [英] How to suppress `warning: linking against dylib not safe for use in application extensions`?
问题描述
我有一个在iOS应用程序和扩展程序之间共享的动态框架。该框架中有一些代码引用了 UIApplication
,这当然不能在扩展中使用。这些调用是完全孤立的,所以我并不担心它们会导致我的扩展程序出现问题。
I have a dynamic framework that is shared between an iOS application and an extension. There is some code in that framework that references UIApplication
, that is of course, not usable in an extension. Those calls are completely isolated and so I am not worried about them causing problems with my extension.
由于警告消息中没有指定标志,可能还有要做到这一点,但我如何禁止 警告:在构建我的项目时,链接到dylib并不安全,无法在应用程序扩展中使用
? / p>
Since there isn't a flag specified in the warning message, perhaps there isn't way to do it, but how do I suppress warning: linking against dylib not safe for use in application extensions
when building my project?
推荐答案
对于你的watch / today-widget扩展目标(所以不是你的app或libray目标),进入项目设置并更改编号设置APPLICATION_EXTENSION_API_ONLY/仅需要App-Extension-Safe API为NO。
For your watch/today-widget extension target (so not your app or libray target), go into the project settings and change the build setting "APPLICATION_EXTENSION_API_ONLY" / "Require Only App-Extension-Safe API" to NO.
这篇关于如何抑制`警告:链接对dylib不安全,无法在应用程序扩展中使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!