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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:30:08+00:00 2026-05-25T13:30:08+00:00

I have a view with a button and a label on it. Now when

  • 0

I have a view with a button and a label on it. Now when I click on that button, I will be taken to another page (view) that displays a Tableview with some values populated in it.

I have successfully coded the button and the label view, and also the populating part of the tableview.

Now what I need to do is, when I click on an item or a row, in the tableview, that value should be shown on the previous page (that contained a button and a label). How should I do this? Any idea?

Note: I can’t provide any code, because I am on my Linux machine 🙁

  • 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-25T13:30:08+00:00Added an answer on May 25, 2026 at 1:30 pm

    Maybe the best solution is coding a protocol.

    In myProtocol.h

    @protocol myProtocol
    
    -(void) didSelectItem: (id) yourItem;
    
    @end
    

    Then, in the interface file of the viewController that contains your tableView:

    @interface MyViewController : UIViewController {
        id <myProtocol> selectionDelegate;
    }
    
    @property (nonatomic, assign)  id <myProtocol> selectionDelegate;
    

    In .m file:

     @synthesize selectionDelegate;
    
    
    
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
    {
        //do something with your data and pass it to the delegate.
        [self.selectionDelegate didSelectItem:myObject];
    [self.navigationController popViewControllerAnimated:YES];
    
    }
    

    The viewController that contains the button and the label must implement your delegate:

    In .h:

    @interface OtherViewController : UIViewController <myProtocol>  {
    
    
    ...
    
    }
    

    In .m:

    -(void) didSelectItem: (id) yourItem
    {
        //do something with your item, set the label and everything...
    
    }
    

    In some part of your code you will have to set the delegate

    Hope this helps

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

Sidebar

Related Questions

I have form area in my view. If I click button A , I
I want to rotate a Button view by 45 degrees. For that I have
I have a view with a button at the bottom of the portrait screen,
I have a view with a button and three UITextFields. The view's background is
I have a view with which I have a button calling the following method.
Here's my case: I have a table view showing contacts. Add button in the
I have a button in a view which refuses to work. I've got in
We have place a button on a view. When we press it, nothing happens.
I am new to iphone development. I have created a button in the view.
I have a custom UITableView cell which has a button and a label. I

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.