2

I'm building a framework (main) which uses another framework (sub). Main framework will be used then in different apps. The main framework target builds without errors. However, if I try to build an App which uses the main framework I receive an error -> Class in the main framework cannot find/import the sub framework... How can I configure main framework so that it will find the sub framework?

Le_Coeur
  • 1,521
  • 5
  • 28
  • 44
  • Not necessarily a duplicate, but there's some discussion of this issue here: http://stackoverflow.com/questions/3516373/can-i-include-a-framework-in-another-framework – mipadi Aug 15 '12 at 20:58
  • Did not understand your solution, you just ran the build script? And what is in this case "general case"? – Le_Coeur Aug 15 '12 at 21:48
  • Here is the answers with screenshots that how we can create a framework inside another framework http://stackoverflow.com/a/27638841/1582217 – Mohd Iftekhar Qurashi Dec 24 '14 at 16:22
  • possible duplicate of [How to create an Umbrella framework in iOS sdk?](http://stackoverflow.com/questions/27484997/how-to-create-an-umbrella-framework-in-ios-sdk) – Mohd Iftekhar Qurashi Dec 25 '14 at 08:00

1 Answers1

3

As I understand you want to create one framework inside another. It is called "Umbrella framework" and it's not a good idea.

Documentations says:

Don't Create Umbrella Frameworks

While it is possible to create umbrella frameworks using Xcode, doing so is unnecessary for most developers and is not recommended. Apple uses umbrella frameworks to mask some of the interdependencies between libraries in the operating system. In nearly all cases, you should be able to include your code in a single, standard framework bundle. Alternatively, if your code was sufficiently modular, you could create multiple frameworks, but in that case, the dependencies between modules would be minimal or nonexistent and should not warrant the creation of an umbrella for them.

You can use one framework inside another, but both frameworks must be included to your app target and must be copied to /Contents/Frameworks/ directory of your app bundle. Also you must set Installation directory to @executable_path/../Frameworks for both frameworks.

Dmitry
  • 7,300
  • 6
  • 32
  • 55
  • Oh my god after all of the convoluted `umbrella`, `sub-umbrella`, `reexport_framework`, `allowable_client` nonsense… I think your **blissfully simple method** of dumping them all in the main executable's frameworks folder... And simply linking away like usual ... To your hearts extent..actually works… _I think_ – Alex Gray Aug 19 '12 at 05:13