How to use a loadable bundle from a static library?
I've created a static library "MyLib.a" with its loadable bundle "MyLibBundle.bundle" which contains all needed resources such as my xcd开发者_StackOverflowatamodel and xibs.
Now, I want to use that library in another project.
So, I included the "MyLib.xcodeproject" in the new one, linked the library and specified the headers search path.
But, after all, the application can't find my core data file (SIGABRT).
Does anybody have a solution?
We had the same problem. Here's the best way we have found so far:
- drag you lib.xcodeproject in your project
- build the lib from your project using the correct scheme
- expand the tree structure until you see the product produced by the build
- right-click, select 'show in finder' it should end up being in ../DerivedData/Projec-HASH/Build/Products/etc...
- drag the .bundle in your project source
- set it to relative to build products (right pane)
Now, in your main scheme, add the bundle as a target to build before your app itself. Also, uncheck parallelize checkbox and make sure the bundle is above the app. This ensure your bundle gets built first, then your app will build.
Hope this helps!
精彩评论