I have been provided with a framework by a third party vendor for an iPhone hardware accessory. So I have a folder like Device.framework. Inside that folder is a binary file and a set of .h files. There are instructions for how to add this to an iOS project and use the classes contained within. However, I'm actually using MonoTouch and want to use a static library.
Is there a way to create a static library that makes all the classes from the framework available in the static library? So in my MonoTouch project I would link in the static library and have access to that framework.
A *.framework is simply a package containing: the static library, headers, associated meta data. Copy and paste the .framework and extract the static *.a file and related header files.
Then it's simply a matter of using the MonoTouch btouch tool to bind the static library for use in your MonoTouch project. There is a great example of how to bind a native library to MonoTouch on Github. With guidance on targeting simulator + device and using the LinkWith attribute to embed the static library in a single *.dll:
Also, make sure to check out the btouch Reference documentation here:
Rename that binary file to Device.a
. You can do that as the framework you mention is not done by Apple, hence it has to be a static library and not a dynamic one.
Make sure your project links that library (Device.a
).
Include the headers in your project and reference them where appropriate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With