views:

93

answers:

2

What is Objective C++ and can I use this language in Xcode?

+1  A: 

Objective-C++ is simply source code that mixes Objective-C classes and C++ classes (two entirely unrelated entities). Your C++ code will work, just as before, and the resulting executable will be linked with the Objective-C runtime, so your Objective-C classes will work as well. You can definitely use it in XCode -- name your files with the .mm extension.

Also, you might want to read Apple's (short!) documentation on Objective-C++: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocCPlusPlus.html#//apple_ref/doc/uid/TP30001163-CH10-SW1)

Doches
+2  A: 

Objective-C++ is Objective-C (probably with COCOA Framework) with the ability to link with C++ code (probable classes).

Yes, you can use this language in XCODE to develop for Mac OS X, iPhone/iPodTouch, iPad. It works very well.

You don't have to do anything weird in your project to use Objective-C++. Just name your Objective-C files with the extension .mm (instead of .m) and you are good to go.

It is my favorite architecture: develop base class library of my game/application in C++ so I can reuse it in other platforms (Windows, Linux) and use COCOA just for the iPhone/iPad UI specific stuff.

Pablo Santa Cruz
cooca? bad typo
Alexander Rafferty
@Alexander: Thanks!
Pablo Santa Cruz
Thanks for the hint on code resuse on multiple platforms!
Saurabh
Its not about *linking* with C++ - did you mean *mixing*?
Georg Fritzsche