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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:55:39+00:00 2026-05-20T04:55:39+00:00

I’m having a difficult time finding how to do true data binding for UITableViews.

  • 0

I’m having a difficult time finding how to do true data binding for UITableViews. I currently have a table view that has a number of custom cells, most of which are simple, and one of which is not. Also, I’m reusing cells as necessary, so at some point, data from any given cell can scroll off the screen, at which point the data is lost from a UI perspective. I need to know the best way (best practice) to get this information and save it.

I can usually show about 4-5 cells at any given time.

Currently all of my data is input via text fields (though this could change soon, as I may add a toggle switch to one of the cells). Each time the user touches out of a text field, textFieldDidEndEditing is called. I then save the data based off of some information from the text field (like tag or placeholder text). I do this because I need to get the data and save it before that cell scrolls out of view, at which point I could no longer save the data by getting the text from the UITextField.

I can’t help but believe there is a better way to do this. My first thought was to find a way to know that a given cell is about to scroll out of view (and thus likely lose it’s value b/c it will be reused), and just save the data at that point. I can’t find anything in the UITableViewController, UITableView, or UITableViewCell class references that hint at anything like this. So, I’m guessing that is not the way to go.

The other thought I had was data binding, which seems the most appropriate, but I can’t find any good examples of this. I need to have a way to bind data to custom objects.

For example, I have an object, say, Contact. This object has a string field for name, a string field for notes, and an Address field (another object) that has it’s own set of fields (like, street1, street2, city, state, zip). I would like to bind these values to the table view such that when a field has been edited, it is saved to my internal object.

Q1: Is there a way to do this?

FYI, the string fields for Contact will share custom cell types, but the Address will get it’s own custom cell with all of the text fields in it. I’m not making different cells for each field in the address, but rather one custom cell with 4 or 5 text fields in it.

To complicate things a little further, I may need to swap out the custom address cell to match that of a different country. So now I need to bind the Address object (ref) to the new custom address cell.

Q2: Does this change the answer to Q1 above?

Again, I’m looking for a better way to save values from custom UITableViewCells with UITextFields, and I have to consider the fact that the data can scroll off the screen and a cell be reused, so not all of the data I need is available to me by the time the user exits the UITableView.

Any help or guidance is greatly appreciated. Even just pointing me to a good resource that I have yet to find.

  • 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-20T04:55:40+00:00Added an answer on May 20, 2026 at 4:55 am

    Currently all of my data is input via text fields (though this could change soon, as I may add a toggle switch to one of the cells). Each time the user touches out of a text field, textFieldDidEndEditing is called. I then save the data based off of some information from the text field (like tag or placeholder text). I do this because I need to get the data and save it before that cell scrolls out of view, at which point I could no longer save the data by getting the text from the UITextField.

    I can’t help but believe there is a better way to do this.

    In my opinion, this is exactly the way to do it. The views should never hold the data. The consequence is that, as soon as the user edits a view, the new data should be saved in the model.

    The other thought I had was data binding, which seems the most appropriate, but I can’t find any good examples of this. I need to have a way to bind data to custom objects.

    Q1: Is there a way to do this?

    No, not on the iPhone. Cocoa on OS X has something like this in the form of Cocoa Bindings in combination with NSArrayController, but this feature is not available on iOS. You have to go the manual route.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a French site that I want to parse, but am running into
this is what i have right now Drawing an RSS feed into the php,
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

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.