简体   繁体   中英

Xcode 6: No Frameworks Folder in Project Navigator

I am using Xcode 6 and following an Xcode version 4 tutorial so things are different here and there.

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.

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).

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'.

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.

In short, no , you shouldn't need to create a Frameworks group yourself as Xcode is doing stuff automatically for you...

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.

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 ).

Suggested reading:

I found the other answers too confusing (where am I supposed to get .framework files?)

It's way simpler in Xcode 6. Just go to Capabilities and turn Maps on. That's it... really.

I would recommend using drag and drop feature to move files into Xcode. Xcode show you the Choose options for adding these files window [Copy items if needed] [Added folders]

For example Xcode can automatically add relative path ( $(PROJECT_DIR)/ ) to:

  • Build Settings -> Library Search Paths if you drag and drop a library
  • Build Settings -> Framework Search Paths if you drag and drop a framework

If you use standard Xcode Groups to organize your files in project — you will eventually find out that it creates mess in your project root folder on a disk. Xcode Groups (folders) exist only virtually, while on the disk you will see plain list of created files in the root directory, and that can potentially lead to some possible uncomfortable situations and even risks. Read more here

I would recommend using drag and drop feature to move files into Xcode. Xcode show you the Choose options for adding these files window [Copy items if needed] [Added folders]

For example Xcode can automatically add relative path ( $(PROJECT_DIR)/ ) to:

  • Build Settings -> Library Search Paths if you drag and drop a library
  • Build Settings -> Framework Search Paths if you drag and drop a framework

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM