将Cocoapods与App Extension一起使用

编程入门 行业动态 更新时间:2024-10-11 03:15:24
本文介绍了将Cocoapods与App Extension一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用cocoapods库在Xcode 6 Beta-6中构建照片App扩展。 Xcode为照片扩展程序创建的桥接标题无法从cocoapods中看到任何内容。

I'm trying to build a photo App Extension in Xcode 6 Beta-6 that uses cocoapods libraries. The bridging header that Xcode creates for the photo extension can't see anything from cocoapods.

例如: #import< GPUImage / GPUImage.h> 导致错误找不到GPUI / GPUImage.h文件。

我已经尝试了所有可以想象的导入路径(括号和引号)并且几乎没有成功。例外情况是,对于像 SVProgressHUD 这样的简单pod,以下丑陋可怕的黑客行为: #import../Pods/SVProgressHUD/ SVProgressHUD / SVProgressHUD.h。

I've tried every conceivable path for the import (with brackets and quotes) and have had almost no success. The exception is that for simple pods like SVProgressHUD, the following ugly terrible hack works: #import "../Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.h".

但是对于GPUImage,它会进入 GPUImage.h 标题,并决定它突然看不到 GPUImageContext.h 尽管没有问题,当导入它的桥接标头为正常的swift代码不属于应用程序扩展。

But for GPUImage, it walks into the GPUImage.h header and decides it suddenly can't see GPUImageContext.h despite having no issue when this is imported with the bridging header for the normal swift code that is not part of the app extension.

有什么不同的应用程序扩展编译阻止桥接标题表现得非常好?

What is different about the compilation of app extensions that is preventing the bridging header from behaving sanely?

注意:我已经阅读了本教程并且它不是立即适用的,以防万一有人认为他们已经找到答案。

Note: I've read every possible permutation of this tutorial and it is not immediately applicable, just in case anyone thinks they have found the answer there.

此外,这个SO qu这可能是相关的,但无论如何我都会问这个问题,以防我的问题特定于应用扩展程序。

Also, the problem described in this SO question may be related, but I asked this question anyway in case my issue is specific to app extensions.

推荐答案

执行此操作的正确方法是更新podfile以仅添加1行:

The proper way to do this is to update your podfile to add just 1 line :

link_with 'yourApp', 'yourAppExtension'

并且pod更新应解决此问题。

and a pod update should resolve the issue.

更多推荐

将Cocoapods与App Extension一起使用

本文发布于:2023-10-10 22:14:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1479909.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Cocoapods   App   Extension

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!