How to create static library from an existing framework in iOS?

后端 未结 2 1784
广开言路
广开言路 2020-12-16 15:21

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

相关标签:
2条回答
  • 2020-12-16 15:25

    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:

    • https://github.com/xamarin/monotouch-samples/tree/master/BindingSample

    Also, make sure to check out the btouch Reference documentation here:

    • http://docs.xamarin.com/ios/advanced_topics/binding_objective-c_types
    0 讨论(0)
  • 2020-12-16 15:51

    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.

    0 讨论(0)
提交回复
热议问题