OC, oc Language
I. Basic syntax
1> OC language and C Language
- C is a process-oriented language, and OC is an object-oriented language.
- The OC language inherits the C language and adds the object-oriented idea.
- The following describes only the differences between the OC language and the C language.
2> keywords
- Start with a letter or underscore
3> string
- The OC language has its own unique string, which is different from the C language string.
4> BOOl type
- Only YES and NO values are available.
- It is essentially a char type, but is interpreted as an integer.
- The BOOL type is introduced by the Conditional compilation mechanism.
5> # import and # include
- Both copy the file content to the code line that appears in the command.
- System files are enclosed in angle brackets and user-defined files are enclosed in parentheses.
- # Conditional compilation commands are included in the import file to prevent the file from being copied multiple times.
6> NSLog and printf
Ii. Classes, objects, and methods
1> class
2> Object
3> Method