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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:44:59+00:00 2026-05-31T09:44:59+00:00

I have a tableview with UITextFields to build a form. I then have a

  • 0

I have a tableview with UITextFields to build a form. I then have a button in the toolbar which launches a modal view controller to select some data which is then passed back to the tableview. However, the new data that was selected does not get refreshed into the UITextField using textField.text = valueReturnedFromModal syntax. Is there something I’m missing?

I see that the data is being returned properly from the modal so that is not the issue. I’m just having trouble forcing the UITextField to refresh with the new data. I’ve tried forcing a reloadData on the tableview as well.

So from the modal view, here’s the code that passes data back:

- (void)doneAccountSelection:(id)sender
{
    [delegate didSelectAccount:currentAccount];
    [self dismissModalViewControllerAnimated:YES];
}

and here’s the actual method in the delegate:

- (void)didSelectAccount:(SFAccount *)selectedAccount
{
    //Ensure a valid deal exists for the account to be attached to
    [self createDealObjectIfNeeded];

    //Set the deal account
    [self.deal setAccount:selectedAccount];

    //Refresh the text fields
    //Tag 3: Account Name field
    UITextField *acct_name = (UITextField *) [self.view viewWithTag:3];
    [acct_name setText:self.deal.account.field_acct_name_value];

    //Tag 4: Account City field
    UITextField *acct_city = (UITextField *) [self.view viewWithTag:4];
    [acct_city setText:self.deal.account.field_acct_city_value];

    //Save the context changes. A new deal gets created above if one does not exist.
    if ([self saveModel]) NSLog(@"Acct object created, attached to deal successfully!");

    [self.tableView reloadData];
}
  • 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-31T09:45:00+00:00Added an answer on May 31, 2026 at 9:45 am

    After some serious debugging found that self.account was being used in cellForRowAtIndexPath to set the initial UITextField values within the UITableViewCell. Then after modal selection completed, I was only updating the account reference for the deal object and not updating the self.account object.

    I then added to this by creating a new method called updateTextFieldsAfterModalFinished and moved the code to update the UITextFields there. This method was then called from didSelectAccount which is the delegate method for modal view that is dismissed. Things are now working as expected and the UITextFields get updated after modal selection is finished.

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

Sidebar

Related Questions

I have a UITextfield in a tableview in a view controller, and I am
I have a table view that has embedded UITextFields for entering some data. It
I have a table view with two rows, both of which have UITextFields in
I have a custom UITableViewCell subclass, and a table view controller which I want
I have a tableview that occupies only the bottom third of my view. I
I have a tableView which has cells with phone numbers. The app is not
I have a tableview which is added to a UIViewController as the tableview only
I have a basic view with a UITextField and a Tableview. I am able
I have some cells in a static table, and the cells contain UITextFields. The
I have two views with navigation controller: first view, there are empty text fields

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.