UIActionSheet Crashes on iPad / not iPhone

前端 未结 6 598
-上瘾入骨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:36

    I also had this problem but I was using [actionSheet showInView:[self.view window]]; (to fix another bug where only half the cancel button is selectable).

    Now I conditionally change this to [actionSheet showInView:self.view]; on the iPad.

    I found it's best not to the style to UIActionSheetStyleBlackTranslucent on the iPad either – the iPad has it's own style, and setting this seems to add the cancel button (which by default on the iPad is not shown).

提交回复
热议问题