UIViewController presentViewController crashing on

2019-07-24 19:01发布

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.

标签: ios8 uikit
1条回答
相关推荐>>
2楼-- · 2019-07-24 19:15

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.

查看更多
登录 后发表回答