Starting today with OC Write iOS program, encountered problems have
1. When different classes use the method of a class or access the properties of a class (public methods or properties), the method or property must be declared in the class header file.
2. The Declaration of the object type and the definition need to use *, indicating that this is a pointer to a piece of memory space. Basic types are not required.
The definition of the 3.init method requires a determination of whether the initialization succeeds (self is not empty).
4. #define can predefine a piece of text, which can be substituted with a predefined variable name when writing code.
5. When using different classes, be careful to import the header files.
6.for in is slightly different from Swift, the syntax is roughly for (type variable name in the collection to traverse) {}
7. Sentence at the end of the semicolon ... (Swift is accustomed to forgetting!) ), if to parentheses (), while to parentheses (), for brackets (), and switch to parentheses () ...
8.NSString format Output Nsinteger, it is best to convert the Nsinteger type to a long type, using%LD to format the output.
9. Categories can omit the name of the custom category (it is not clear what is different from the extension ...) Valid only in the current class? Or is it something else? The Viewcontroller used this ...
So far, the difference between @class and import is not clear. Perhaps import can know what property methods are in the class? @class don't know? Later to delve into ...
OBJECTIVE-C study notes-third day (1)