Search code examples
iphonecocoa-touchuiactionsheet

Multiple UIActionSheets in one View Controller


How are multiple UIActionSheets added to a single UIViewController if there is only a single -actionSheet:clickedButtonAtIndex: method?


Solution

  • Set a Name or Tag to your Action sheet and do some thing like this

      -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
     {
       if(actionSheet==yourActionsheet1)
         {
          //your logic
           }
         if(actionSheet==yourActionsheet2)
         {
          //your logic
           }
        }
    

    hope this help