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

  • SEARCH
  • Home
  • 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 813197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:19:15+00:00 2026-05-15T01:19:15+00:00

how can i know what tableview cell was selected?(being in the detail view) The

  • 0

how can i know what tableview cell was selected?(being in the detail view)
The problem is that.
I have an table view controller. Here are parsed from the internet entries to the table.
So it’s a dynamic tabe view that loads from internet. I will not know how many entries will be in the table so i will not know what details view to call when i click a row.
So i have maked one view. This view contains an calendar. On this calendar(wich is the detail iew) i will parse data from internet depending on the selected row.
For exemple: i have table: entry 1, entry 2,entry 3,entry 4
When i click entry 2 i need to call a php with the argument entry 2. The php will know what entry on the table i have selected and will generate me the correct xml that i will parse.

Here is my tableview didSelectRow function:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Navigation logic -- create and push a new view controller

 if(bdvController == nil)
    bdvController = [[BookDetailViewController alloc] initWithNibName:@"BookDetailView" bundle:[NSBundle mainBundle]];
  Villa *aVilla = [appDelegate.villas objectAtIndex:indexPath.row];

  [self.navigationController pushViewController:bdvController animated:YES]

And here is my self view function on detailviewcontroller:

-(void)loadView {

    [super loadView];

    self.title=@"Month"

    UIBarButtonItem *addButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"ListView" style:UIBarButtonItemStyleDone target:self action:@selector(add:)];
    self.navigationItem.rightBarButtonItem = addButtonItem;

    calendarView = [[[KLCalendarView alloc] initWithFrame:CGRectMake(0.0f, 0.0f,  320.0f, 373.0f) delegate:self] autorelease];
    appDelegate1 = (XMLAppDelegate *)[[UIApplication sharedApplication] delegate];

    myTableView=[[UITableView alloc]initWithFrame:CGRectMake(0, 260, 320, 160)style:UITableViewStylePlain];
    myTableView.dataSource=self;
    myTableView.delegate=self;
    UIView *myHeaderView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, myTableView.frame.size.width,2)];
    myHeaderView.backgroundColor=[UIColor grayColor];
    [myTableView setTableHeaderView:myHeaderView];

    [self.view addSubview:myTableView];
    [self.view addSubview:calendarView];
    [self.view bringSubviewToFront:myTableView];
}

I think that here in self load i need to make the if procedure..
If indexPath.row=x parse fisier.php?variabila=title_of_rowx
but the question is how i know the indexPath variable?

  • 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-05-15T01:19:16+00:00Added an answer on May 15, 2026 at 1:19 am

    You can set a property on BookDetailViewController:

    BookDetailViewController.h:

    @interface BookDetailViewController : UITableViewController {
        NSIndexPath *selectedIndexPath;
    }
    @property (nonatomic, retain) NSIndexPath *selectedIndexPath;
    @end
    

    BookDetailViewController.m

    @implementation BookDetailViewController
    @synthesize selectedIndexPath;
    - (void)dealloc {
        [selectedIndexPath release];
    }
    // ...
    @end
    

    tableView:didSelectRowAtIndexPath

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
        // Navigation logic -- create and push a new view controller
    
        if(bdvController == nil) {
            bdvController = [[BookDetailViewController alloc] initWithNibName:@"BookDetailView" bundle:[NSBundle mainBundle]];
        }
        bdvController.selectedIndexPath = indexPath
        Villa *aVilla = [appDelegate.villas objectAtIndex:indexPath.row];
    
        [self.navigationController pushViewController:bdvController animated:YES]
    }
    

    Depending on what you’re doing in your application it may make more sense to make the property a Villa object rather than an NSIndexPath.

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

Sidebar

Related Questions

does anybody know how i can access a custom cell within the - (void)tableView:commitEditingStyle:forRowAtIndexPath:.
Feel like I'm going a bit nutty here. I have a detail view with
I have custom table view cell with images (loaded from app document directory), labels,
Do you know how can I display a large NSString on a tableView cell?
dont know whats wrong with my table view, I have a dictionary(this dictionary is
I can subclass the cell and resolve the problem, but I'd like to know
like in java I have: Class.getSuperClass().getDeclaredFields() how I can know and set private field
Is it a good practice to initialize columns that we can know their values
When customizing an UITableView, how can I know wether the cell is the first,
I have this setting below, but when I touch the table cell, I get

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.