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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:57:07+00:00 2026-05-26T23:57:07+00:00

In my app there is a table view. When a row in the table

  • 0

In my app there is a table view. When a row in the table view is selected a UIView appears and shows information.
The row title comes from a plist file with strings in it.
The plist file also includes strings with a phone number associated with the row title.
In the custom UIView I have a button, when you click the button I want it to call the number which is declared in the plist file.
The number which is associated with the row the user clicked.

How could I accomplish this?

The action is a ordinary IBAction:

- (IBAction)callNumber:(id)sender;

It is connected to the button in IB (in Xcode 4).

I would appreciate if someone had a solution to my problem, thanks.

Edit

For some clarity, I would like to get the phone number which is associated with the row you select in the table view. The string in the plist has a key, for the phone number name: “phone”.

NSString *phone = [[tableList objectAtIndex:indexPath.row] objectForKey:@"phone"];

“tablelist” is a NSMutableArray. I would like to get the key “phone” and store it in the NSString *phone. All this in a IBAction. Would it help to post the whole class?

  • 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-26T23:57:08+00:00Added an answer on May 26, 2026 at 11:57 pm

    You need to have a property on the “custom view” that indicates the index path of the row that was selected. You can put this in your custom view controller’s header to declare this property:

    @interface MyCustomViewController : UIViewController {
        ...
        NSIndexPath * indexPath;
    }
    @property (nonatomic, retain) NSIndexPath * indexPath;
    

    Then, setup the implementation like this:

    @implementation MyCustomViewController
    @synthesize indexPath;
    ...
    // only needed if not using ARC
    - (void)dealloc {
        self.indexPath = nil;
        ...
        [super dealloc];
    }
    @end
    

    Now, in the tableView:didSelectRowAtIndexPath: method, simply create the view controller as usual, but set the indexPath property on it so that it can be accessed in the future:

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
        MyCustomViewController * vc = [[MyCustomViewController alloc] initWithBundle:nil nibName:nil];
        [vc setIndexPath:indexPath];
        [self presentModalViewController:vc];
        // if not using ARC
        [vc release];
    }
    

    Then, anywhere in MyCustomViewController.m, simply write self.indexPath.row to get the row of the index path that was selected.

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

Sidebar

Related Questions

Is there a database term for table or view? In my app, the table
In the amazon iphone app home page there is a grouped table view that
I've got an app that has a table view that displays contact information in
In my app there is a table view and it have some image view
I'm creating a grails app over a legacy database. There is a table out
I've created a table view in an iPhone app using Interface Builder (IB). My
In my table view I have 4 UIButton s, 2 in each row of
I have an app I am working on, that has a table view with
When selecting a row from the master view of UISPlitViewControler when its in popover
I have an app that has a TableView, NavigationView and TabBar running together. There

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.