1. the header file is still. h
2. cpp is changed to. M.
3. # import replaces # include, # import is guaranteed to be referenced only once, which is equivalent to # ifndef # define # endif mode in. h.
4. Use @ interface... @ End to declare the class and replace Class classname {}
5. Use @ implementation... @ End to implement classes
6. Put data members in @ interface classname: parent {... }, The default permission is @ protected, which is called instance variables in objc.
7. Put member functions in @ interface classname: parent {}... @ End, which is called instance methods in objc
8. The declaration method of instance methods is: scope (returntype) methodname: (parameter1type) parameter1name;
9. scope is divided into two types: instance and class, which are represented by-and + respectively.
10. The method is called [ Object Method], equivalent Object -> Method ()
11. The method with parameters is called [ Object Method: parameter]
12. No Object , Only pointer Object
13. Common constructor: Object * OBJ = [[ Object Alloc] init]
14. destructor method: [OBJ release] 15. method declaration with multiple parameters: scope (returntype) methodname: (parameter1type) parameter1name label1name: (parameter2type) parameter2name... ;
16. labelname is not required
17. This special syntax comes from smalltalk.
18. Private: [list of vars] protected: [list of vars] public: [list of vars] changed to @ private, @ protected, @ public
19. Class variable implements implicit regression using the static method
20. + (void) initialize will be called during construction
21. objc generally uses the @ symbol to represent the derivative part of the language.
22. objc uses the ID to list the pointer of the demonstration object
23. Support for dynamic Type Recognition
24. The categories mechanism can be used to add new functions without inheriting existing classes.
25. The posing mechanism allows child to replace parent
26. Protocol is equivalent to pure virtual class
27. objc is managed by two memory methods: 1) Retain and release, 2) Retain and release/autorelease
28. The foundation is equivalent to STL. nsarray corresponds to vector and nsdictionary corresponds to map.
29. objc does not support namespace
30. overload is not supported