Do not repost the labor results of developers
Objective-C is obviously different from other object-oriented systems.
The following describes the features of this method: compatibility, word
String, class, method, attribute, protocol, and classification.
1. Compatibility
Objective-C is an object-oriented C language. In objective-C code, there can be C and C ++ statements,
It can call C functions or access methods through C ++ objects.
2. String
Objective-C generally does not use a C-language string.
In most cases, it is a string of the nsstring type that uses the foundation framework.
The nsstring class provides string class packaging and supports Unicode and printf-style formatting tools.
It places a @ symbol before a regular double quotation mark string,
The following is an example:
NSString* myString = @"My String\n";NSString* anotherString = [NSString stringWithFormat:@"%d %s", 1, @"String"];
3. Class
Objective-C is an object-oriented language, and defining a class is its basic capability.
The class description and implementation of objective-C include the Interface part and the implementation part.
4. Method
Objective-C is an object-oriented language, and the definition method is also its basic capability.
In objective-C, the method uses the [] operator instead of the "." operator.
Sometimes a method call is also called message sending.
5. Attributes
Attribute is a concept proposed by objective-C 2.0,
It is an alternative to the "Getter" and "setter" methods for accessing member variables,
To encapsulate a class, you can access the class through attributes instead of directly accessing the member variables.
6. Agreement
The protocols in objective-C are similar to interfaces in Java or pure virtual classes in C ++,
Only some interface definitions are not implemented, that is, only the H file does not have m files.
7. Classification
In objective-C, categories are similar to inheritance mechanisms, and can be used to extend the features of parent classes.
Objective-C's magic path [1-objective-c features]