This has me stumped and hoping to have some light shed on it.
myFraction = [Fraction alloc];
myFraction = [myFraction init];
The book says "The allco method is guaranteed to zero out all of the objects instance variables. However, that does not mean that the object has been properly initialized for use. You need to initialize an object after you allocate it."
I don't understand what they mean by "zero out". My guess would be that it means if I have any instance variables in objects they would disappear or be zeroed out??? But how can they be zeroed out if I still need to initialize them? Wouldn't they already be zeroed (not storing any variables) when the second step happens?
Thanks,
-Lars
myFraction = [Fraction alloc];
myFraction = [myFraction init];
The book says "The allco method is guaranteed to zero out all of the objects instance variables. However, that does not mean that the object has been properly initialized for use. You need to initialize an object after you allocate it."
I don't understand what they mean by "zero out". My guess would be that it means if I have any instance variables in objects they would disappear or be zeroed out??? But how can they be zeroed out if I still need to initialize them? Wouldn't they already be zeroed (not storing any variables) when the second step happens?
Thanks,
-Lars