1, OC language is evolved from Smalltalk. The language uses message structure rather than function call.
In the language of the message structure , the code executed by the runtime is determined by the operating environment;
The compiler does not need to be concerned about what type of object is receiving the message, but only at run time to find the method to be executed, which is also called dynamic binding .
The language used by the " function call " is determined by the compiler.
2. The OC object is allocated in the heap , and the OC object cannot be allocated in the stack (stack) .
The memory allocated in the heap must be managed directly, and the memory allocated on the stack to hold the variable is automatically cleaned up when its stack frame pops up. (That is, heap memory is managed by programmers (using the " reference counting " mechanism), and stack memory is automatically managed by the system. )
3, creating objects is more expensive than creating structs, so if you only need to save "non-object types" such as int, float, double, char, and so on, you can usually use structs.
The structure is allocated in the stack.
1th: Understanding the origins of Objective-c language