Question

The error I'm getting:

in /Users/robert/Documents/funWithFrameworks/build/Debug-iphonesimulator/funWithFrameworks.framework/funWithFrameworks, can't link with a main executable

Cliff notes:

  • trying to include framework
  • doesn't want to link

More detail: I'm developing for a mobile device... hint, hint using Xcode and I'm trying to make my own custom framework which I can include from another application. So far, I've done the following:

  1. Create a new project; an iPhone OS window based app.
  2. Go to target info-> under packaging, change the wrapper extension from app to framework
  3. Go to Action->new build phase -> copy headers. Change roles of headers to 'public'
  4. From my application, I add the framework to the frameworks group.
Was it helpful?

Solution

Apple clearly said that you can not use dynamic libraries on their mobiles. And a private framework is just this.

You can, however, use static libraries.

OTHER TIPS

Egil, that's usually considered as one of the implications of section 3.3.2 of the iPhone developer agreement, which (in part) forbids plug-in architectures or other frameworks. The fact that they don't provide an Xcode project template for an iPhone-compatible framework tends to reinforce the idea, though of course it could just be an oversight or something they're discouraging without actually forbidding.

Whether this is the intended meaning of that section is something you'd have to ask Apple about, and possibly consult a lawyer, but this is where the oft-stated "no frameworks" idea comes from.

For those who have framework code they'd like to use in an iPhone app, an alternative approach is to use the framework code to build a static library. That then gets compiled into the application instead of getting dynamically loaded at run time. The fact that it's part of the application executable avoids any potential concerns about this part of the agreement.

Though dynamic libraries are not allowed, you CAN create a framework (using static libraries and lipo).

Check out: http://accu.org/index.php/journals/1594

I haven't tried it for so called mobile device, but I would guess its very similar to the method for a regular Cocoa application. Check out this tutorial:

Embedded Cocoa Frameworks

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top