Reputation: 826
I have added an action sheet in my app. My application is tab bar based app. I have added this in this way
actionSheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"Take photo",@"Use existing photo",nil];
actionSheet.actionSheetStyle = UIBarStyleBlackTranslucent;
[actionSheet showFromTabBar:self.view];
But it shows warning:
How can I remove it. As the same time I am in the tab in which I want to display the action sheet.
Upvotes: 1
Views: 266
Reputation: 71
[actionSheet showFromTabBar:self.tabBarController.tabBar];
Try this ,it might help you.
Upvotes: 2
Reputation: 44633
If you are in the tab, shouldn't it be [actionSheet showFromTabBar:self.tabBarController.tabBar];
?
Upvotes: 1
Reputation: 10344
If you are use tabbar controller then use like this
[actionSheet showFromTabBar:(UITabBar *)[appDelegate.tabBarController view]];
Upvotes: 0