December 2013
Beginner
576 pages
16h 4m
English
Whenever you implement a setter or getter method, think about what you’re storing in the instance variables, what you’re retrieving, and whether you need to protect these values. For example, consider this when you set the name of one of your AddressCard objects using the corresponding setter method:
newCard.name = newName;
Assume that newName is a string object containing the name for your new card. Assume that inside the setter routine you simply assigned the parameter to the corresponding instance variable:
-(void) setName: (NSString *) theName{ name = theName;}
Now, what do you think would happen if the program later changed some of the characters contained in ...
Read now
Unlock full access