问题
I have been given a dylib library and a hpp header file that I should use in my iOS project in Xcode. I've been looking through the internet, but all the answers are succinct and short, with no specific steps to follow.
Do I just copy these files into my project? How can I then create/use an object from the library within an Obj-C class? Do I need any wrapper class or something? do I have to change something in the build settings or in build phases? (these are the kind of questions that arise in my mind)
Does anyone know what are the steps to follow? or somewhere I could make more research?
Any help would be much appreciated.
回答1:
- Add your dylib file to your project folder using Finder.
- Select Target and then go to build phases tab in Xcode.
- Select "Link Binary With Libraries".
- Click on + to add files.
- Select the file from the list.
- If file is not in the list, click on "Add other", browse to the location of file and select it.
- The file will get added to your project.
来源:https://stackoverflow.com/questions/38201797/how-to-use-dylib-library-and-hpp-header-file-in-ios-project