Thursday, December 24, 2009

UIActionSheet vs UITabBarController

So have you tried to slide up an Action Sheet only to have the Tab Bar Controller below make clicking the bottom link a serious challenge?

Instead of this:

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Title" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"w00t!" otherButtonTitles:nil];
[actionSheet showInView:self.view];
[actionSheet release];

Try this:

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Title" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"w00t!" otherButtonTitles:nil];
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[actionSheet showInView:appDelegate.window];
[actionSheet release];