Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check why viewWillDisappear: is called

I need to check if viewWillDisappear: is called because I am presenting another UIViewController as modal or not. Does anyone know if this is possible?

UPDATE

I want to know why it is being called. For example, if its being popped or if another viewcontroller is shown as modal. I need to differentiate the both.

like image 249
AlexanderN Avatar asked May 30 '13 12:05

AlexanderN


2 Answers

This is only a partial answer to your question, but have a look at "Determining Why a View’s Appearance Changed" in the "View Controller Programming Guide for iOS".

For example, you can call [self isBeingDismissed] from within viewWillDisappear to determine if the view controller was just dismissed (e.g. popped from the navigation stack).

like image 166
Martin R Avatar answered Oct 14 '22 00:10

Martin R


You can set a breakpoint in that method or do NSlog(@"ViewwillDisapper"); So, you can verify whether that method is calling or not.

like image 44
iPhone developer. Avatar answered Oct 13 '22 22:10

iPhone developer.