UIActionSheet Crashes on iPad / not iPhone

前端 未结 6 561
-上瘾入骨i
-上瘾入骨i 2021-01-03 16:24

When I look in the console I get this message

2010-09-18 17:04:05.284 Wasted Time[8998:207] *** Assertion failure in -[UIActionSheet showInView:], /SourceCache/UI         


        
6条回答
  •  别那么骄傲
    2021-01-03 16:51

    This is an old question, but I encountered the same problem today. I have a xib file for a UIViewController that's common to iPhone and iPad, and the showInView method on the UIActionSheet was causing the iPad app to crash.

    Turned out calling showInView in the viewDidAppear, instead of viewDidLoad fixed it for me. Perhaps all IB connections weren't made by the time viewDidLoad was called on iPad.

    (my UIViewController was being pushed onto a UINavigationController, so I wonder if the increased animation time is what caused the whole issue_

提交回复
热议问题