- The program files are divided into header files (. h) and implementation files (. m);
- Use the #import keyword to import the desired header file into the program, and you can avoid the program repeatedly referencing the same header file;
- @autoreleasepool {...} to release the pool automatically;
- Symbol "@" is widely used, reflecting the new characteristics of objective-c;
- Print output using NSLog execution Console (for example: NSLog (@ "Hello world!") );
- With Objective-c own Boolean type--bool, the value is: yes/no;
- The ID data type, the generic object pointer, can represent any object type;
- Use nil to denote empty objects;
Summarize:
1. The key words in OC begin with @.
2, the beginning of the program, C is the #include<.h> OC is the #import<.h>; #import比 # # # # # # # # # # It's good to see if the header file has been imported before importing the header file, and if not, import the header file. If you have already imported it, you are no longer repeating the import header file.
3. @interface representative declares a class;: (colon) represents inheritance
4, NSString function: 1, inform its length; 2, compare itself with other strings, 3, convert itself to an shaping value or a floating point value.
5.Nil represents an empty object,null represents a null pointer,nil represents an empty class, andNSNull represents an empty object in the OC collection.
6. The default value for char type is-0
OBJECTIVE-C program structure and grammatical features