I am working with Automatic Reference Counting.
I have a custom UIViewController
subclass and whenever I call -presentViewController: animated:completion
To get a print when the View Controller is deallocated you can implement the dealloc method as
- (void) dealloc {
NSLog(@"The instance of MyViewController was deallocated");
}
Then to get a print when the View Controller left the view you can implement
- (void) viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
NSLog(@"The instance of MyViewController left the main view")
}