user79854
user79854

Reputation:

Loading external .bundles on iPhone

I would like to add resource files to a .bundle and push them to my application and it seems to work fine in the simulator but fails to build when I change to the device.

/Users/sosborn/Projects/MyPro/build/Debug-iphoneos/FooBar.bundle: object file format invalid or unsuitable

I don't want to load any code or anything, just plain text and jpegs and it would be nice to be able to package them as dependencies.

Upvotes: 0

Views: 567

Answers (3)

user79854
user79854

Reputation:

I found a better solution to my problem. It actually doesn't require the use of bundles at all. I just created an aggregate target instead of a bundle target. Then I added a copy step and a script step. The copy step contains all of the resources I had in the bundle target and the script step actually zips up the files. Then when I download the content into my application I can just unzip it and use it just as if it were a bundle since I'm just storing resource dependencies.

Thanks for your help.

Upvotes: 0

Andrew Pouliot
Andrew Pouliot

Reputation: 5421

Instead of trying to load it like an NSBundle, just reference the resources therein by path.

You could pretty easily create your own class that did something similar to the non-code stuff in NSBundle to help out, as there really isn't much logic in there.

Upvotes: 0

rpetrich
rpetrich

Reputation: 32326

iPhones and iPod touchs do not have support for loading external modules (neither bundles nor dylibs). If you need to share object code between projects, you can use static libraries

Upvotes: 1

Related Questions