Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8710205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:34:05+00:00 2026-06-13T04:34:05+00:00

I have an action sheet which works like this: – (void)Method1 { UIActionSheet *photoSourceSheet=[[UIActionSheet

  • 0

I have an action sheet which works like this:

- (void)Method1 {
    UIActionSheet *photoSourceSheet=[[UIActionSheet alloc]
                                     initWithTitle:@"Options"
                                     delegate:self
                                     cancelButtonTitle:@"Exit"
                                     destructiveButtonTitle:nil
                                     otherButtonTitles:@"opt1",@"opt2", @"opt3", nil];
    photoSourceSheet.tag=1;
    photoSourceSheet.delegate=self;
    [photoSourceSheet showInView:self.view];
}

- (void)Method2 {
    UIActionSheet *photoSourceSheet1=[[UIActionSheet alloc]
                                      initWithTitle:@"Select Video"
                                      delegate:self
                                      cancelButtonTitle:@"Cancel"
                                      destructiveButtonTitle:nil
                                      otherButtonTitles:@"Take New Video", @"Choose Existing Video", nil];
    //   photoSourceSheet.delegate=self;
    photoSourceSheet1.tag=2;
    photoSourceSheet1.delegate=self;
    [photoSourceSheet1 showInView:self.view];
}

then in my delegate i have:

- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex: NSInteger)buttonIndex {
    if (actionSheet.tag==1) {
        if (buttonindex==2) {
            [self method2];
        }
    } else if (actionSheet.tag==2) {
        // some code
    }
}

My delegate method gets called for the first action sheet i.e. photoSourceSheet but not for photoSourceSheet1.
Is there something special I need to do, like manually dismissing the sheet?
My second UIActionSheet (photoSourceSheet1) appears but it crashes the app as soon as I select an option on the sheet.
It throws EXEC_BAD_ACCESS

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:34:06+00:00Added an answer on June 13, 2026 at 4:34 am

    There is nothing wrong with the above code.
    EXEC_BAD_ACCESS is basically due to ill Memory Management.Sometimes you unintentionally remove the object that is being used.
    Try enable Zombies it will tell you the exact problem area.

    Steps: Go to Edit Scheme
    Memory Management
    Check the option enable Zombie Objects

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: UIActionSheet *actionSheet = [[[UIActionSheet alloc] initWithTitle:@Illustrations delegate:self cancelButtonTitle:@Cancel destructiveButtonTitle:nil otherButtonTitles:
I have controller users . In this controller I have action account which is
I have an iOS iPhone app for which I need the Action Sheet-style buttons
I have a UIActionSheet (sheet A for short) with a switch statement of which
I have a date picker which is shown using an action sheet. I want
I'm displaying an UIActionSheet on the iPad this way: _actionSheet = [[UIActionSheet alloc] initWithTitle:@Choose
I have an action sheet with options that vary depending on the circumstances. There
I have a action result method i would like to run. How can i
I have this action for updating data: def edit @project = Project.find(params[:id]) if @project.team
I have a action link on my MVC3 razor view. Which have a action

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.