i am using UIviewcontroller subclasses. In my main view i have 3 buttons, each button will load a different nib. and each new nib is having one back button to come back to main view.
when i click one the back button of any view to move to the main view the dealloc of that view is not getting called? i didnt understood this.
can anyone explain when those views dealloc will be called?
i am using UIviewcontroller subclasses. In my main view i have 3 buttons, each
Share
if the dealloc method hasn’t been called, it means that your retained your viewController object by hands. for example, in this case dealloc will not be called after clicking back button to return
You should add
to this code to be sure that your instance of viewController will be deallocated. If you are absolutely sure, that you had sent equal number of
alloc(or any message that increases object’s retainCount) andreleasemessages for your object and dealloc method doesn’t be called anyway, it will be more complex. I hope that this answer will help. If you will find that your situation is “more complex”, post a comment, then I’ll try to explain with more details.