Saturday 28 January 2012

Calling C/C++ functions from Objective C

I Have just started my first proper project Xcode and found myself wanting to re-use C and C++ code.

Do it like this:

Create a c/cpp file and header in XCode

Write some c or cpp code

Include the header in your objective C file

Call your code! easy.

If the code is cpp, then you have to rename your objective C file (.m) to .mm


No comments:

Post a Comment