• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Creating an umbrella framework
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating an umbrella framework


  • Subject: Re: Creating an umbrella framework
  • From: Ofri Wolfus <email@hidden>
  • Date: Thu, 23 Mar 2006 20:26:02 +0200

I managed to hack something that did the trick. If someone has a better way, please let me know :) Here is goes:
1) Set the install directory of the sub framework to "@loader_path/../Frameworks/" and compile normally.
2) Add "-sub_umbrella MySubFramework" to the other linker flags of your super framework.
3) Add a copy build phase which will copy your sub framework into the super framework's "Frameworks" folder.
4) Add this script to the super framework's build phases and replace "YourFramework" with your super framewprk's name:
#!/bin/sh

FRAMEWORK_DIR="$BUILT_PRODUCTS_DIR/YourFramework.framework"
FRAMEWORKS_DIR="$FRAMEWORK_DIR/Versions/Frameworks"

if ( ! [ -e "$FRAMEWORKS_DIR" ]); then
ln -s "$FRAMEWORK_DIR/Versions/Current/Frameworks" "$FRAMEWORKS_DIR"
fi
5) Add (and copy) the super framework to your app and weak link it with all of the sub frameworks of your umbrella framework (by adding "-weak_framework subFramework" to the other linker flags).

This produces 2 warnings saying the app can't find the sub framework(s), but it launches and operates normally.

- Ofri

On 23/03/2006, at 16:49, Ofri Wolfus wrote:

Thanks but I already read and did what that document says. I still can't manage it to work though... :(
That's really a shame that umbrella frameworks are so discouraged by apple.

- Ofri

On 23/03/2006, at 05:51, Chris Espinosa wrote:

On Mar 22, 2006, at 11:35 AM, Ofri Wolfus wrote:

Hi,

I'm trying to create a framework which contains another framework inside it. I did some reading, and I found that the -sub_framework flag should do exactly what I want. The problem I have is that this umbrella framework is designed to be included inside an app's bundle, so I set the sub framework's install dir to @loader_path/../Frameworks and added a script that will create a sym link in umbrellaFramework.framework/Frameworks that points to umbrellaFramework.framework/Versions/Current/Frameworks (and yes, I am coping the sub framework into the umbrella framework).
Now when I try to link an app to my framework, I get a warning saying it can't locate/open the sub framework. When I try to run my app, it just crashes on launch saying:

"dyld: Library not loaded: @loader_path/../Frameworks/subFramework.framework/Versions/A/subFramework
Referenced from: pathToUmbrellaFramework/umbrellaFramework.framework/Versions/A/umbrellaFramework
Reason: image not found"

Can anyone please tell me what am I doing wrong?

"Don't Create Umbrella Frameworks"
http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/CreationGuidelines.html

"Packaging Frameworks and Libraries under an Umbrella Framework"
http://developer.apple.com/documentation/developertools/Conceptual/MachOTopics/Articles/loading_code.html

And remember, it's -sub_framework, not -sub-framework.

Chris


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Creating an umbrella framework (From: Ofri Wolfus <email@hidden>)
 >Re: Creating an umbrella framework (From: Chris Espinosa <email@hidden>)
 >Re: Creating an umbrella framework (From: Ofri Wolfus <email@hidden>)

  • Prev by Date: Re: Problem importing from CodeWarrior into Xcode (2.2.1)
  • Next by Date: Unable to locate a (newly added) framework in XCode
  • Previous by thread: Re: Creating an umbrella framework
  • Next by thread: Incorporating 3rd party static libraries into a composite static library.
  • Index(es):
    • Date
    • Thread