Remember how the C build model works; It is the Objective-C files including C++ headers that must be switched over to Objective-C++.
Objective C adding C++
-
30-06-2022 - |
Question
I have been given some C++ classes to incorporate into my Objective C project. I've never done this before, so I have to ask:
- Is there something special I need to do or can I just rename the .cpp to .mm?
- What about importing (or including) the .h file? Anything special I need to do there?
Just baby steps here. Thank you.
Solution
OTHER TIPS
See my answer to this question. Basically, the .mm
convention is a nicety, not a necessity. If you use the File Inspector to set up the file types of the .h\.m\.cpp
files correctly, you can get Objective-C to play nicely with C++ files without difficulty.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow