I am using Xcode 6 and following an Xcode version 4 tutorial so things are different here and there.
我正在使用Xcode 6并遵循Xcode version 4教程,所以这里和那里的情况是不同的。
There doesn't seem to be a Frameworks folder in my project navigator and so when I downloaded some .framework files and added them manually in the build phase of my project editor, I had no Frameworks folder to save them in and just let them fall into the top of my project navigator. So they are there, just not in a special folder, and it doesn't look good.
似乎没有一个框架的文件夹在我的项目导航器,所以当我下载一些.framework文件和手动添加在我的项目编辑器的构建阶段,我没有框架文件夹保存他们,让他们落入我的项目导航器的顶部。它们在那里,只是不在一个特殊的文件夹里,看起来不太好。
So should Xcode 6 have a frameworks folder automatically, or do I need to create one myself? And if so, how can I do that? (I've only added new files so far).
那么Xcode 6是否应该自动创建一个框架文件夹,或者我需要自己创建一个框架文件夹呢?如果是的话,我怎么做呢?(到目前为止我只添加了新文件)。
3 个解决方案
#1
47
In Xcode 6, the Frameworks folder is not added by default. You can drag and drop your .framework files into the project navigator (tick 'Copy items if needed'), then select them all > right click > "New Group from Selection" and name the folder 'Frameworks'.
在Xcode 6中,默认情况下不会添加框架文件夹。您可以将.framework文件拖放到项目导航器中(如果需要,请勾选'Copy items if necessary '),然后选择所有的>右键单击>“New Group from Selection”,并将文件夹命名为“framework”。
Also, make sure the frameworks are added into the Project > Build Phases > Link Binary With Libraries. If not, drag them there from your newly created 'Frameworks' folder.
另外,确保将框架添加到项目>构建阶段>与库的链接。如果没有,请将它们从新创建的“框架”文件夹中拖到那里。
#2
5
In short, no, you shouldn't need to create a Frameworks group yourself as Xcode is doing stuff automatically for you...
简而言之,不,您不应该自己创建一个框架组,因为Xcode正在自动地为您做事情……
Apple are slowly, gently pushing developers in the direction of newer Clang features with the goal of making native iOS development more approachable for newbies who don't have previous experience of compiling and linking with C-based languages.
苹果正在缓慢地将开发人员推向更新的Clang特性,目标是让没有编译和链接基于c语言经验的新手更容易使用本地iOS开发。
You'll find that Objective-C projects created with Xcode 6 have new build settings enabled by default including Link Frameworks Automatically (CLANG_MODULES_AUTOLINK
) and Enable Modules (C and Objective-C) (CLANG_ENABLE_MODULES
).
您将会发现,使用Xcode 6创建的Objective-C项目有新的构建设置,默认情况下启用了链接框架(CLANG_MODULES_AUTOLINK),并启用了模块(C和Objective-C) (CLANG_ENABLE_MODULES)。
Suggested reading:
建议阅读:
- Modules (Clang documentation)
- 模块(叮当声文档)
- @import vs #import - iOS 7 (excellent Stack Overflow answer)
- @import vs . #import - ios7(优秀的栈溢出回答)
#3
2
I found the other answers too confusing (where am I supposed to get .framework files?)
我发现其他的答案太令人困惑(我应该从哪里获得.framework文件?)
It's way simpler in Xcode 6. Just go to Capabilities and turn Maps on. That's it... really.
它在Xcode 6中更简单。只要打开功能并打开地图。就是这样……真的。
#1
47
In Xcode 6, the Frameworks folder is not added by default. You can drag and drop your .framework files into the project navigator (tick 'Copy items if needed'), then select them all > right click > "New Group from Selection" and name the folder 'Frameworks'.
在Xcode 6中,默认情况下不会添加框架文件夹。您可以将.framework文件拖放到项目导航器中(如果需要,请勾选'Copy items if necessary '),然后选择所有的>右键单击>“New Group from Selection”,并将文件夹命名为“framework”。
Also, make sure the frameworks are added into the Project > Build Phases > Link Binary With Libraries. If not, drag them there from your newly created 'Frameworks' folder.
另外,确保将框架添加到项目>构建阶段>与库的链接。如果没有,请将它们从新创建的“框架”文件夹中拖到那里。
#2
5
In short, no, you shouldn't need to create a Frameworks group yourself as Xcode is doing stuff automatically for you...
简而言之,不,您不应该自己创建一个框架组,因为Xcode正在自动地为您做事情……
Apple are slowly, gently pushing developers in the direction of newer Clang features with the goal of making native iOS development more approachable for newbies who don't have previous experience of compiling and linking with C-based languages.
苹果正在缓慢地将开发人员推向更新的Clang特性,目标是让没有编译和链接基于c语言经验的新手更容易使用本地iOS开发。
You'll find that Objective-C projects created with Xcode 6 have new build settings enabled by default including Link Frameworks Automatically (CLANG_MODULES_AUTOLINK
) and Enable Modules (C and Objective-C) (CLANG_ENABLE_MODULES
).
您将会发现,使用Xcode 6创建的Objective-C项目有新的构建设置,默认情况下启用了链接框架(CLANG_MODULES_AUTOLINK),并启用了模块(C和Objective-C) (CLANG_ENABLE_MODULES)。
Suggested reading:
建议阅读:
- Modules (Clang documentation)
- 模块(叮当声文档)
- @import vs #import - iOS 7 (excellent Stack Overflow answer)
- @import vs . #import - ios7(优秀的栈溢出回答)
#3
2
I found the other answers too confusing (where am I supposed to get .framework files?)
我发现其他的答案太令人困惑(我应该从哪里获得.framework文件?)
It's way simpler in Xcode 6. Just go to Capabilities and turn Maps on. That's it... really.
它在Xcode 6中更简单。只要打开功能并打开地图。就是这样……真的。