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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:56:10+00:00 2026-05-22T20:56:10+00:00

I have two UITableViewControllers. One displays a list of names and on tapping any

  • 0

I have two UITableViewControllers. One displays a list of names and on tapping any cell will push the second TableViewController which enables the user to edit the name in a UITextField.

Now I am able to pass the name string from the first TableViewController to the second. (I’m doing this by creating a property in the second TableViewController which I’m setting just before pushing the second TableViewController) But how do I pass the edited name string from the second to the first (so that I can update the first table with the edited name)?

  • 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-22T20:56:11+00:00Added an answer on May 22, 2026 at 8:56 pm

    Create a mutable array property in the first controller, and pass that array and an index to the second controller.

    FirstController.h

       @property (nonatomic,retain)     NSMutableArray *myStrings;
    

    FirstController.m

       @synthesize myStrings;
    
       init {
             self.myStrings = [NSMutableArray arrayWithCapacity:8];
       }
    
    
       didSelectRowAtIndexPath {
    
         SecondVC *vc = [[SecondVC new];
         [self.theStrings addObject:@"Original String"]; // or replaceAtIndex: indexPath.row
         vc.theStrings = self.myStrings;
         vc.theIndex   = indexPath.row;
         //push detail vc.
       }
    

    SecondController.h

      @property (nonatomic, retain) NSMutableArray *theStrings;
      @property (nonatomic        ) int             theIndex;
    

    SecondController.m

      @synthesize theStrings;
      @synthesize theIndex;
    
      doneEditingMethod {
           [self.theStrings replaceObjectAtIndex: self.theIndex withObject: myNewString];
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SplitViewController which has two UITableViewControllers - one master/root one detail. Everything
I have two UITableViewControllers. I'm pushing to the second one and calling the following
I have two classes (MVC view model) which inherits from one abstract base class.
I have a UINavigationController with two UITableViewControllers pushed onto its stack. Is there any
I have two View Controllers: TableViewController (which is used as a modal view controller)
I have a class which subclasses the UITableViewCell. This cell will be used in
I have two UITableViewControllers with a fairly simple ui flow. One UITableViewController loads another
I have two UITableViewControllers. In the first UITableView, once a user selects a cell,
Have two actionsheet buttons and one modalviewcontroller on mainviewcontroller in application. Now for two
I have three separated class, UIViewController (A) and two UITableViewControllers (B and C). 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.