Let's say you have something like this:
ivarOutsideOfBlock = @"foo";
[doSomethingThatTakesAwhile start:^(NSError *error) {
if(!error){
ivarOutsideOfBlock = @"somethingElse";
// Might crash because iVarOutsideOfBlock may no longer exist
}
}];
At this point, let's say the reference to the ivar, the view controller, gets dealloacted. The code will crash right (INVALID ADDRESS)?
What is the best practice around this? Is it to convert the ivar into a strong property on the view controller?