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 9270175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:18:17+00:00 2026-06-18T15:18:17+00:00

I have UITableViewController which pop UIActionSheet when user click on a cell with accessoryType

  • 0

I have UITableViewController which pop UIActionSheet when user click on a cell with accessoryType =UITableViewCellAccessoryDetailDisclosureButton;

Now the method -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { works fine, except, i dont know in which cell user clicked.

I could , for example, declare a property where I save selected cell in didSelectRowAtIndexPath:(NSIndexPath *)indexPath { but I think there must be a better way.

  • 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-18T15:18:18+00:00Added an answer on June 18, 2026 at 3:18 pm

    If your table only have one section, you could store which row presented the action sheet in the tag, something like this.

    - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
        NSString *title = [NSString stringWithFormat:@"Sheet for row %i", indexPath.row];
        UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:title delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"Option 1", @"Option 2", nil];
        [sheet setTag:indexPath.row];
        [sheet showInView:self.view];
    }
    
    - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
        int row = actionSheet.tag;
        NSLog(@"Selected actionSheet buttonIndex %i for row: %i", buttonIndex, row);
    }
    

    It’s probably the easiest way, but I wouldn’t say it’s the best way to do it.

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

Sidebar

Related Questions

I have a UITableViewController which lets the user drill down into different records. On
I have a UITableViewController which in it's tableView:didSelectRowAtIndexPath method, sets up a view controller,
I have UITableViewController which contains a list of items. Now, I want the list
i've UITableViewController which have static cell. I would like to show another detailed view
I have a UITableViewController which creates dynamically re-sizeable cells. The cell changes the size
I have an UITableViewController which I would like to add UIToolbar to with one
I am using a UITableViewController which uploads a table. I have a Nib File
I have a UITableviewController and I push another UIViewController in 'didSelectRow..' method. I have
I have a UITableViewController that displays cells that are just default. Each cell can
I have a UITableViewController and UITableViewCell . This cell contains three text fields. Each

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.