This is incorrect:
- (void) dealloc
{
self.caption = nil;
self.photographer = nil;
[super dealloc];
}
Using the dot syntax will invoke a setter whose implementation might change if the class is subclassed, which can be the cause of subtle errors. Also, if you're using KVO (Key-Value Observing), invoking the setter might notify observers who then try to work with a (partially) deallocated object.This is standard:
- (void) dealloc
{
[caption release];
[photographer release];
[super dealloc];
}