Monotouch and native iOS code

Is it possible to link a C # library compiled using monotouch with an objective-C interface in one application, or should the application be all or nothing?

+4
source share
1 answer

It is possible, but you will not get any help from the MonoTouch tool, and you cannot get away from the fact that you still need a Mono executable to run C # code.

To ensure Mono execution for an Objective-C application, the runtime must be integrated into the application. There are several documents on the MonoTouch website on how to do this here , and you can find additional technical details about implementing Mono in your application here .

MonoTouch, when compiling C # code, creates the .m and .s files that Objective-C uses to call this code. These files should be included in the consuming Objective-C project, but MonoTouch cleans these files after using them. To save the mtouch MonoTouch compiler by deleting the .m and .s files, use the -keeptemp option when invoking the compiler. You can find a good Makefile sample here to help you understand how to properly invoke mtouch from the command line.

Finally, for this you will need the full version of MonoTouch. The trial version will not generate .s files.

+3
source

Source: https://habr.com/ru/post/1334736/


All Articles