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

The Archive Base Latest Questions

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

I have an edit screen which is comprised of one huge UITableView. Each cell

  • 0
  1. I have an edit screen which is comprised of one huge UITableView.

    1. Each cell in the table is a custom UITableViewCell comprising of a UITextField

    2. I am able to load up the table, scroll around and enter information. However, during scrolling the table cells lose the data entered and I understand why this happens.

    3. I realize I need to save the data as soon as the user finishes entering the data using the textFieldDidEndEditing method.

Question: I want to store the data entered in a custom object that is available in the ViewController – how do I access this from the UITableViewCell? Also, how do I identify the row and position of the table cell so that based on the position I can populate a specific attribute in the object

Question: Am I doing this the right way? Or is there a better way to do this?

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

    As you are mentioning only a single text field, we can make do with an NSMutableArray object containing strings for each cell. You will have to fill the array with empty strings and use this info to fill the text field. It will be something like,

    textField.text = [textFieldStrings objectAtIndex:indexPath.row];
    

    Since you’re doing it programmatically within the view controller, you will have to set the view controller as your text view delegate. You can do

    - (void)textFieldDidEndEditing:(UITextField *)textField {
        UITableViewCell *cell = (UITableViewCell*)textField.superview;
    
        NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
    
        ... Since you've the index path, you can map it to an array.
    
        [textFieldStrings replaceObjectAtIndexPath:indexPath withObject:textField.text];
    }
    

    This would be the basic idea. Start with a mutable array of empty strings and modify them every time the text field is updated by replacing the original text with the new text. 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 a screen which functions similarly to the address book contact screen. The
I have a script that appends some rows to a table. One of the
Edit: I have solved this by myself. See my answer below I have set
EDIT: I have submitted a bug report and Microsoft have acknowledge that it is
EDIT: I have added Slug column to address performance issues on specific record selection.
What are extension methods in .NET? EDIT: I have posted a follow up question
have downloaded Orca to edit an MSI file. I want to remove some banner
EDIT: I also have access to ESXLT functions. I have two node sets of
I have found a few libraries to edit MP3 tags (UltraID3Lib is great) but
I have a compiled swf file and a I can't edit it , but

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.