views:

66

answers:

2

Can somebody point me in the right direction for this. I've found lots of info on using c++ in obj c but not the other way around. I am making an iPhone game in c++ but need to tap into some of the features the iPhone has to offer.

Thanks

A: 

Normally the way is to do the opposite, you rename your files to .mm and then use C++ in the files. It sounds as if you are trying something will cause you extra work without necessarily any benefits.

Anders K.
+1  A: 

There's actually no difference between "using C++ in Objective-C" and "using Objective-C in C++" - they're both actually using Objective-C++ (which is a distinct language).

Just make sure that you're compiling the source file as Objective-C++: either rename it with a .mm extension, or add the compiler flag -x objective-c++ to affect all of your source files.

Then you can do just about anything that you would do in Objective-C.

Jesse Beder