+53  A: 

Just found a possible answer:

01-Dec-2008 10:22 PM Tom Saxton: I looked at this bug some more, and it seems to be an issue with the tabbar.

If you call UIActionSheet's [sheet showInView:self.view] from a view controller that is a child of a UITabViewController, then the hit testing on the cancel button fails in that portion of the UIActionSheet that lies above the tabbar's view.

If you instead pass in the UITabBarController's view, then the UIActionSheet acts as expected.

NOTE: in iPhone OS 2.1 and earlier, the UIActionSheet came up from the top of the tab bar when you pass the child view, but in 2.2, it comes up from the bottom of the tab bar, and thus covers the tab view.

http://openradar.appspot.com/6410780

Edit: It works correctly when I change the view to be the tab bar's view

[sheet showInView:self.parentViewController.tabBarController.view];
nevan
You've just helped me solve a problem I didn't know I had!
James Raybould
Upvoted this because it works. Why is this better than the other answers?
bentford
An answer that keeps on helping... nice work!
crunchyt
Great answer - thanks very much.
barfoon
Wow! amazing! good good!!
cappuccino
Yep, this one had me thinking my mouse was broken.. thanks!
petert
Why the parentViewController? Even if the view is in a navigationview tabBarController should still point to the right place. Works for me without the parentViewController in any case.
Nathan Reed
Another answer seems potentially better. Look for [actionSheet showInView:[self.view window]]. Seems more straight forward and more generic.
Kevin
+4  A: 

I found an answer over here that works:

http://stackoverflow.com/questions/1174734/how-do-you-control-action-sheet-animation-direction

using: [filterActionSheet showInView:[self.view window]];

i tried a few ways to get to my tab bar and they way this app is set up it seem convoluted...

driveguy
PERFECT! Thanks. This is the correct solution for me, as I was having this issue with a UITableViewController that had a toolbar *not* a TabBar like others here.
William Denniss
Works for me! Thanks!
nonamelive
+6  A: 

Instead use:

[sheet showFromTabBar:theTabBar];
Corey Floyd
I corrected this from `showInTabBar:` to `showFromTabBar:`. Also note that there's a 'showFromToolbar:` method, depending on what screen furniture you have at the bottom of the screen. This, I think, is a better answer than the accepted answer.
Stephen Darlington
Stephen, curious why you think this is better than specifying showInView:theTabBar? From a coupling perspective I'd think that showInView would probably be more ideal, in case later on the tabBar is dropped, maybe replaced with a toolbar, for instance. The particular sub view controller shouldn't really have to know or care, I'd think.
Billy Gray
If the tab bar is dropped later, you're going to have to edit that line of code regardless (unless perhaps theTabBar is a poorly-named reference to a view that's passed in). So I don't see how this method is any more coupled than showInView:theTabBar.I use showFromTabBar: as well, as it seems safer to me. I don't know what's going on under the covers, but I imagine that showFromTabBar: is less likely to break in future OS releases than showFromView: with a tab bar view.
chrispix
+3  A: 

I appparently can't 'vote up' another answer. If I could I would have for driveguy. [filterActionSheet showInView:[self.view window]]; is much easier and worked great for me. Rob

dny238
This worked for me while the other solutions have not
Chris Gillum
A: 

Thank you thank you thank you. This caused me an hour's frustration before I decided on a brute force google search. nevan's answer of 7/29 works well.

+2  A: 

The accepted solution:

[sheet showInView:self.parentViewController.tabBarController.view];

worked best for me, as I was working within a subview of the "MORE" Navigational controller of the TabBar Delegate. The solution worked great to bring the ActionSheet right to the front for proper clicking of the "Cancel" button.

Newbyman
A: 

thanx nevan it workd..thnx again..

AJith
A: 

you are brilliant guys! Thank you so much. I was really frustrated and this saved me :)

Lukas Petr
A: 

The [sheet showInView:self.parentViewController.tabBarController.view]; does not work for me. Do you need other relevant code to use this line?

The [sheet showInView:[self.view window]]; works.

lionfly
A: 

FYI - had the same problem with UIDocumentInteractionController's actionsheet stepping on the tabbar. Used the following to fix.

UIViewController *parentView = [[self parentViewController] parentViewController];
[docController presentOptionsMenuFromRect: rect inView: parentView.view animated:YES];
Mickey