Search code examples
iphoneipaduiviewdelegatesuiactionsheet

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.


Solution

  • If you are use tabbar controller then use like this

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