Here's a scenario:
A view controller pushes a new controller to the nav controller. This child controller creates a model that uses a NSURLConnection. When this connection finishes it will make a call like the following:
[self.delegate modelDidFinishParsing:self];
What is the safe way to produce this code? Right now, I have this code and it crashes in a certain situation:
if ([self.delegate conformsToProtocol:@protocol(ModelDelegate)]) [self.delegate modelDidFinishParsing:self];
The situation when it crashes is when the view controller that owns the model is popped from the stack before the model finishes. Should I make the model an ivar so that the controller releases it in its own - (void)dealloc
?