December 2013
Beginner
576 pages
16h 4m
English
If an id data type can be used to store any object, why don’t you just declare all your objects as type id? For several reasons, you don’t want to get into the habit of overusing this generic class data type.
First, when you define a variable to be an object from a particular class, you are using what’s known as static typing. The word static refers to the fact that the type of object that will be stored in the variable is being explicitly declared. So the class of the object stored in that type is predeterminate, or static. When you use static typing, the compiler ensures, to the best of its ability, that the variable is used consistently throughout the program. The compiler can check to ensure that a method ...
Read now
Unlock full access