how to make a wrapper from .dylib to objective-C
I have created three dynamic libs in .dylib for MACOSX. It's mainly C/C++ code coming from linux ported to MAC to create an app.
I have added these 3 libs to my Xcode project and modify the build phase settings to link them at build/run time to the binary.
I have seen the API belows:
dlopen() dlsym()...using these APIs I can load my dylib but I'm not sure that I'm doing it the right way. What I need to do is to create an app for OS X which use the dylib to access to some features to control a device through USB. One of the lib content is the MTP lib.
I'm not sure if I need to use dlopen() as the lib is already declared in the build phase settings.
I do not really know how to make it easy to access to all APIs in these libraries. Do I need to create (.m/.h file) which link the API C/C++ functions from my dylib to Objective-C functions to make it easier to use. It make more sens for me to do it because it would be more clear.
If yes, do someone as an example on how to do this "wrapper", how the .m / .h is able to link and connect to the dylib. After I would just need to use for example a include of the .h in the main.m to access to the function from the dylib.
Thanks for your help
Sebastien
MacBook, OS X Mavericks (10.9.5)