2
votes

Hello, I am new to Xcode and programming in iOS. I am having some troubles in my actionsheet and my alert, have to press twice to work. Its also says this: "Presenting actionsheet clipped by its superview". Some controls might not respond to touches. On iPhone try -[UIActionSheet showFromTabBar:] or -[UIActionSheet showFromToolbar:] instead of -[UIActionSheet showInView:].

{
    UIActionSheet   *actionSheet = [[UIActionSheet alloc]
                                  initWithTitle:@"¿?" delegate:self cancelButtonTitle:@"No" destructiveButtonTitle:@"Send" otherButtonTitles:nil];

    [actionSheet showInView:self.view];
}

any help will be appreciated thanks!

4

4 Answers

5
votes

You need to put it in the tabbar (or toolbar) so instead of:

 [actionSheet showInView:self.view];

do

 [actionSheet showFromTabBar:self.tabBarController.tabBar];
1
votes

If your application is using a navigation bar (and not a tool bar) on the screen where you want to present the UIActionSheet, try to present it on the tool bar of the navigation controller.

This would also present the action sheet even if you have hidden your navigation controller's toolbar.

[myActionSheet showInView:self.navigationController.toolbar]

0
votes

I had same problem and I resolved using [actionSheet showInView:self.parentViewController.view]; instead of self.view , if you used tabbar or naviatinbar

0
votes

This method is also working, it hides "Presenting action sheet clipped by its superview" warning.

[actionSheet showInView:[UIApplication sharedApplication].keyWindow];