Question

I have three view controllers pushed in navigationcontroller on the third one i used the statement

[self.navigationController popToViewController:(Main_View*) mainViewObj animated:YES];

It takes me directly to my specified controller say first. I have done some coding to remove objects from an NSMutableDictionary in viewWillDisappear method in all view controllers, i tried debugging using break points but it never comes to viewWillDisappear, it takes me directly to Main_View. Should i be worried about removing objects from dictionary or releasing it?

Was it helpful?

Solution

The viewWillDisappear: method is not called for the other view controllers because they have already disappeared when you were pushing view controllers on top of them. So basically, viewWillDisappear: was already called for them at an earlier point. It wouldn't make sense to call it again, because they weren't visible in the first place.

OTHER TIPS

You can try to keep weak references to your NSMutableDictanories in your AppDelegate, then after poptoviewcontroller in mainViewController get them, and see, if they are nil, or not, and if not, you can remove objects from Dictionaries in your main view with that references.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top