Herman
Herman

Reputation: 3024

UIViewController presentViewController crashing on ios 8

Just got this error in our error logging system, been searching hi and low and can't seem to find any solution. Any help is appreciated. Here is the stacktrace.

Upvotes: 2

Views: 3177

Answers (1)

code2kick
code2kick

Reputation: 83

May be in your XCODE log you might have encountered this message

"Presenting view controllers on detached view controllers is discouraged ".

If yes then then try

[self.view.window.rootViewController presentViewController:myVC];

if this fails then make sure you call presentViewController:myVC on immediate presenting ViewController i.e. in your case what I see from trace - CalendarEventDetailViewController.

If that too fail then go backward - from where you are invoking VC which in turn use presentViewController, in iOS8 presentation layer has changed specially WRT UIAlert/UIActionSheet, and UIPopovers, if you are using any of these, create UIAlertController as a separate code track for iOS8 and use presentViewController:myVC on presenting ViewController.

I was facing similar issue where presentViewController: not working at all or disrupting presenting VC contents, in some situations dismissViewController was crashing. Using this approach I could fix it.

Upvotes: 1

Related Questions