Xcode 6: No Frameworks Folder in Project Navigator
Asked Answered
J

4

25

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

Jackie answered 19/10, 2014 at 15:5 Comment(0)
A
49

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.

Annular answered 19/10, 2014 at 16:4 Comment(0)
E
5

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:

Espionage answered 24/11, 2014 at 11:30 Comment(3)
Thanks Quintin. I've had a look at Swift and it looks pretty appealing to me as one of aforementioned newbies.. good idea to shelve obj-c for now? would be glad to get your opinion.Jackie
I have, as yet, not had any time to expose myself to Swift so I couldn't say for sure. It's going to depend on what you're developing. If I were producing a greenfield app then I would seriously consider it. However, for library developers I understand it's currently a non-starter (at least for public interfaces due to Apple's lack of willingness to commit to future binary compatibility - see here)... Equally, both Xcode and Objective-C are getting progressively 'easier' to use so I would persist with learning the aboriginal toolkit if you can!Espionage
I want to develop both games and apps. I like how sparse and clean swift looks but will keep going with obj-c for a while and learn swift alongside I guess!Jackie
D
2

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.

Disassemble answered 24/2, 2015 at 6:31 Comment(9)
It's fairly simple actually. Just create a 'Frameworks' folder in Xcode and add the framework files to it. :)Annular
@Annular then you have to locate the framework files first. This is not my definition of simple, much easier to just click a checkbox.Disassemble
What do you exactly mean by 'locating the framework files'? Once you got the .framework file, it's as easy as adding it to the user-created 'Frameworks' folder in Project Navigator. It's usually added to build phases automatically, as well.Annular
@Annular yes 'once you get the framework file'. The annoying part is having to track down the .framework file first and then copy it. it's at least 5 steps instead of one.Disassemble
also, Xcode has the functionality built in, so why wouldn't you use what they built for you?Disassemble
Are you talking about 3rd party frameworks or the iOS provided ones? You don't have to track down system frameworks. You can just add them in 'Link binary with files'. For 3rd party frameworks it's still as easy. You usually download the .framework file from a vendor and just drag it into Xcode.Annular
@Annular for system frameworks that is still not as intuitive as using the method that Xcode has built in for youDisassemble
You're right, but in this case the question is about 3rd party frameworks. :)Annular
I can't turn off the Maps capability any more and I don't need it. How do I get rid of the Maps capability one I used it to create the frameworks folder?Ascites
S
1

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
Sherbet answered 6/12, 2019 at 15:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.