Syntax overview
1. There is no package name (namespace) concept in Java, in order to prevent two class names with the same class conflict, you can put these two classes in different packages. There is no concept of "package" in OC, that is, there is no namespace mechanism, instead the developer prefixes the class name and uses the prefix to effectively prevent class name collisions. For example, NSString (the String class in OC), Nsarray (an array class for OC), and their prefixes are NS 2. The keywords all start with @ 1> I said earlier that the OC code can be mixed with C language, C + + code, The C language and C + + as a programming language, have their own keywords. To prevent conflicts with C and C + + keywords, the OC keyword begins with @. Some common keywords are listed below.
@interface, @implementation, @[email protected], @protected, @private, @selector @try, @catch, @throw, @finally @protocol , the new keywords introduced in @class//OC 2.0 are @property, @synthesize @optional, @required, @dynamic
2> even strings are preceded by @, such as @ "Hello" is the OC Red string, and "Hello" is a string in C language.
3. Key points in grammar
Objective C Overview