Problems with Cancel Button and UIActionSheet

前端 未结 3 1028
星月不相逢
星月不相逢 2021-02-19 20:13

How do I determine if the cancel button was pressed on a UIActionSheet?

My UIActionSheet is set up like this:

-(IBAction)fileButtonPressed
{
    UIAction         


        
3条回答
  •  天涯浪人
    2021-02-19 20:35

    if (buttonIndex == actionSheet.cancelButtonIndex)
    {
        // Handle cancel action
    }
    

    UIActionSheet also has properties like destructiveButtonIndex and firstOtherButtonIndex to compare against.

提交回复
热议问题