Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
915 views
in Technique[技术] by (71.8m points)

objective c - iOS framework with dependencies

I have created two iOS .frameworks

they both compile perfectly

my structure is as follows:

iPadProject
  - framework1
     - framework2

So Framework2 is included in framework1 and framework1 is included in the actual iPad Project

So my problem is, if I add both framework1 and framework2 into my iPadProject it won't compile because its whining about duplicate symbols from framework2 ( that's logical because it was already included in framework1)

But if i only include framework1 into my iPadProject when i access a method from framework1 that in his turn access a method from framework2 it crashes the application with "signal SIGABRT"

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Do not nest static libraries, including iOS frameworks. As you've seen, it leads to major problems (it leads to even more problems when two frameworks each have their own version of the third). The final link step should link all libraries required; static libraries should never link other static libraries. There is no really good way to automate this; it just has to be part of the documentation for the framework.

You shouldn't be getting runtime exceptions, though, for failing to link a framework. You should be getting link-time failures that indicate that the symbol isn't defined. If you're getting a crash, that suggests you're doing something strange in your linking.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...