Dynamic Typing & Dynamic Binding:

Dynamic Typing in Objective C means that the class of an object type id is unknown at the compile time and is discovered at the run time based on the message sent to the Object.

Dynamic typing allows us to declare a variable that is capable of storing any type of object regardless of its class origin, this is achieved using the Objective C id type, the id type is a special, general purpose data type that can be assigned an object of any type.

Dynamic binding takes this one step further by allowing methods on object type id to be called without prior knowledge of the type of an object currently assigned to the variable.


2 comments: