IOS 5 - presentModalViewController nils parentViewController in self?

I'm still trying to figure out some issues with iOS 5 and iOS 4 in this incredibly complex (and not necessarily) complex application.

I traced one problem to the point where the controller (which happens to be the navigation controller of the calling class) has a parentViewController attached before the request for the current parentViewController is sent, but on the other hand, they didnโ€™t even return viewWillAppear โ€œpresentedโ€ controller in viewWillAppear with a call), the navigation controller (I checked that it is the same address) suddenly has nil parentViewController .

I am sure that this behavior did not happen in iOS 4 (I tested ping-pong between the two versions to check the behavior).

The code is too complicated to include here, but the call is:

 [self.navigationController presentModalViewController:messageViewController animated:[self isAnimated]]; 

Before the call, there are allegations that the parentViewController navigation is non-zero, as well as in viewWillAppear . The statement only fails in viewWillAppear .

+4
source share
2 answers

It was in the manual: Change in iOS5

+9
source

Source: https://habr.com/ru/post/1380855/


All Articles