在Xcode中导入私有框架 [英] importing private frameworks in Xcode
问题描述
我是新手iPhone程序员我想使用私有框架中的一些功能
I am a novice iPhone programmer I want to use some of the functions in the private framework
https://github.com/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中导入私有框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!