Search code examples
iphonexcodeuiactionsheet

Action Sheet Within ActionSheet


am new to Objective C and iPhone Development. Kindly tell me how can i add an action sheet within action sheet. Like when i tap a button an action sheet is opened and then I clicked the first ButtonIndex of action another action sheet appears. Kindly mention the complete code. Thanks


Solution

  • All you want to do is dismiss the first UIActionSheet and show another UIActionSheet in it's place. In other words, you don't want to show a UIActionSheet within another UIActionSheet -- you want to show a UIActionSheet after a different UIActionSheet has been dismissed.

    To find out when an action sheet is being dismissed, you should implement the UIActionSheetDelegate protocol. For example:

    - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex {
    // first action sheet is dismissed
    // show a new action sheet here
    }