I came around a interesting issue while working on my app. Imagine the scenerio where
In the last step, suppose while calling the methods of A, B finds that the A object doesnt exist anymore. Then what happens???
I'm not sure but does it cause crash?
If yes, then please suggest me how to avoid the situation.
In my case I assigned the viewcontroller as delegate of some object, say X in viewDidLoad
method. There are cases when viewcontroller get destroyed before X calls the delegate methods defined in the viewcontroller.
In short, which method is called only once while unloading phase of view controller likewise
viewDidLoad
in its loading phase.
Checking against a valid delegate object should be sufficient enough.
if (delegate)
[delegate method];