What is Objective C++?
Solution 1
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 (sadly deleted, but archived) documentation on Objective-C++.
Solution 2
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.
Related videos on Youtube
Saurabh
I am AWS Certified Solution Architect (https://www.certmetrics.com/amazon/public/badge.aspx?i=1&t=c&d=2017-09-06&ci=AWS00294125). My areas of expertise are iOS development, Objective C, Swift, Cross Platform Apps, React Native, Node.js, MongoDB, PHP, MySql, AWS, Cloud Computing, High Availability, High Scalability, VPCs, Project Management. http://makebetterthings.com/
Updated on October 31, 2020Comments
-
Saurabh over 3 years
What is Objective C++ and can I use this language in Xcode?
-
Dave Voyles over 6 years@JörgWMittag I'm sorry, but you're response has been closed as not a real question by Stack Overflow moderators.
-
-
Georg Fritzsche over 13 yearsIts not about linking with C++ - did you mean mixing?