In objective C, files normally use the extension . h for interface files and the extension . m for implementation files.
An MM file is a source code file that can contain both Objective-C and Objective-C++ programming code. It is used on MacOS and differentiates from .
You just need to change the extension to . mm. There is no option to create a file with . mm extension in Xcode.
mm are class file extensions of source code for Mac-based applications. . m files can contain both Objective-C and Objective-C++ classes. To avoid conflicts between the two in mixed-use scenarios there's the convention to rename all Objective-C++ class files to . mm .
.mm extension stands for Objective-C++, when compiler can process C++ classes. But when using .m extension it will be able to compile only C code, without C++ classes.
Both .m
and .mm
are class file extensions of source code for Mac-based applications. .m
files can contain both Objective-C and Objective-C++ classes. To avoid conflicts between the two in mixed-use scenarios there's the convention to rename all Objective-C++ class files to .mm
. This helps compilers to distinguish.
So in a project which uses both Objective-C and Objective-C++ you will see:
.m
files containing Objective-C
.mm
files containing Objective-C++
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With