name = @"Jed"; // accesses the instance variable directly
self.name = @"Jed"; // access the setter method of the instance variable.
// again, from stanford course@implementation Person
- (void)setAge:(int)newAge {
[self setAge:newAge]; // Infinite loop!
}
@end
No comments:
Post a Comment