开发者

Hide UIActionSheet on iPad

开发者 https://www.devze.com 2023-02-12 02:43 出处:网络
I just got a mail from apple that my iPad app was rejected because my \'app contains popover elements that didn\'t pointto the element that revealed them and more than one popover element visible onsc

I just got a mail from apple that my iPad app was rejected because my 'app contains popover elements that didn't point to the element that revealed them and more than one popover element visible onscreen at a time'.

The problem is that I call an actionsheet which is still visible when I switch from one view to another and that there can be called to actionsh开发者_开发技巧eets at a time. Now I ask myself how I can hide an actionsheet on a view change or when another actionsheet is opend.


I solved the issue with the sheet showing multiple times when you tap the same button by checking isVisible, as in the following:

- (IBAction) btnFoo: (id) sender
{
    if ([self.sheet isVisible]) {
        [self.sheet dismissWithClickedButtonIndex:self.sheet.cancelButtonIndex animated:YES];
        return;
    }

    [self.sheet showFromBarButtonItem:sender animated:YES];
}

Hope that helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号