Hi,
I am working through a book on Cocoa and Objective-C. One example has stumped me:
- (id) currentObject {
return [Photo photo];
}
- (void) checkObjectType {
id object = [self currentObject];
...
}
In this case, checkObjectType calls currentObject. currentObject then returns an instance of Photo, however, it's creating a new instance of Photo and returning this reference, is it not ? Isn't it not return a reference to itself ? I was expecting something like:
return self;
Thanks,
Scott