Sandeep Singh
Sandeep Singh

Reputation: 826

Action Sheet warning?

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: enter image description here

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

Answers (3)

koti
koti

Reputation: 71

[actionSheet showFromTabBar:self.tabBarController.tabBar];

Try this ,it might help you.

Upvotes: 2

Deepak Danduprolu
Deepak Danduprolu

Reputation: 44633

If you are in the tab, shouldn't it be [actionSheet showFromTabBar:self.tabBarController.tabBar];?

Upvotes: 1

Chetan Bhalara
Chetan Bhalara

Reputation: 10344

If you are use tabbar controller then use like this

[actionSheet showFromTabBar:(UITabBar *)[appDelegate.tabBarController view]];

Upvotes: 0

Related Questions