在Xcode中导入私有框架

编程入门 行业动态 更新时间:2024-10-26 03:33:45
本文介绍了在Xcode中导入私有框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是新手iPhone程序员我想使用私有框架中的一些功能

I am a novice iPhone programmer I want to use some of the functions in the private framework

github/kennytm/iphone-private-frameworks

该功能我想在'SpringBoard'中使用

The function that I want to use is in 'SpringBoard'

所以我在github repo中下载了'SpringBoard'文件夹。 并在'SpringBoard'中创建一个名为Headers的子目录,并将所有头文件放在该文件夹中。

So I downloaded 'SpringBoard' folder in that github repo. And created a subdirectory called "Headers" in 'SpringBoard' and put all the header files in that folder.

并重命名为'SpringBoard'到'SpringBoard.framework'并将其复制到/ Developer / Platforms /(iPhoneOS_and_iPhoneSimulator)/ sdks / System / library / Frameworks文件夹(我无法回想起正确的道路抱歉)

And renamed 'SpringBoard' to 'SpringBoard.framework' and copied it to /Developer/Platforms/(iPhoneOS_and_iPhoneSimulator)/sdks/System/library/Frameworks folder (I can't recall full path correctly sorry)

我回到xcode并右键单击Frameworks - >添加现有框架 - >其他 - >我选择'SpringBoard.framework'文件夹并单击Add。

And I got back to the xcode and right click on Frameworks -> Add existing framework -> other -> I selected 'SpringBoard.framework' folder and clicked Add.

我构建了项目并收到错误

And I built the project and got an error

'ld:框架SpringBoard未找到'

'ld : framework SpringBoard not found'

我的导入的框架确实出现在Xcode上,我可以在其中看到头文件。 但是当我构建它时我得到了这个错误。

My imported framework does appear on the Xcode and I can see header files in it. but when I built it I got that error.

我做错了什么?

推荐答案

将所有私有标题放在以下目录中: / User / Name / Headers / 然后设置 USER_HEADER_SEARCH_PATHS =/ User / Name / Headers /并确保 ALWAYS_SEARCH_USER_PATHS = YES

Place all of your private headers in a directory like: /User/Name/Headers/ then set USER_HEADER_SEARCH_PATHS = "/User/Name/Headers/" and make sure that ALWAYS_SEARCH_USER_PATHS = YES

另外,SpringBoard.framework不是这样做的。只需在上面的Headers文件夹中放置名为 SpringBoard 的文件夹,确保标题直接在其中。例如: SpringBoard / SBAlert.h

/* SpringBoard is not a framework. */

请注意,您不必将SpringBoard文件夹添加到项目中,它们应该显示为您开始输入,只要你正确设置上面的标题。

Notice that you wont have to add the SpringBoard folder to your project, they should appear as you start typing, as long as you set the above headers correctly.

更多推荐

在Xcode中导入私有框架

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

发布评论

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

>www.elefans.com

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