[Reading Notes] iOS-Objective-C's basic knowledge of C extension, iosobjectivec
1. Xcode's. m extension indicates that the file contains Objective-C code, which should be processed by the Objective-C compiler. The C compiler processes the file whose name ends with. c, and the C ++ compiler processes the. cpp file. In Xcode, all these compilation tasks are handled by GCC. This compiler can understand all three variants of C language.
2. When Objective-C was born, the extension. m represents message, which is a major feature of Objective-C.
3. Like C, Objective-C uses header files to Contain element declarations, including struct, symbolic constants, and function prototypes. C uses the # include statement to notify the compiler to query the definition in the header file. # Import is provided by the GCC compiler. Xcode uses it when compiling Objective-C, C, and C ++ programs. # Import ensures that the header file is contained only once, no matter how many times the Command actually appears in that file.
4. in C language, programmers usually use a solution based on the # ifdef command to avoid the situation where one file contains another file, while the latter contains the first file. In Objective-C, programmers use # import to implement this function.
5. When NSLog () is used to output the value of any object, the % @ format description is used. When this description is used, the object provides its own NSLog () through a method named description () format, NSString description method can simply output characters in the string.
References: Objective-C basic tutorial