문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top