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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:39:23+00:00 2026-06-10T10:39:23+00:00

I have created a five column (text boxes) cell (row) in table view controller

  • 0

I have created a five column (text boxes) cell (row) in table view controller with an option of add button. When a user clicks on add button, a new row (cell) with five column (text boxe) is added in a table view controller with null values. I want that when user fills the text boxes the data should get saved in database or if he changes any data in previous text boxes also it get saved.

this is my save btn coding..

- (IBAction)btn_save:(id)sender
{
    NSInteger noOfRow=[(NSSet *)[projectObject valueForKey:@"rs_project_Input"] count];
    NSLog(@"Save Btn: No of rows for saving %d",noOfRow);
    for (row1=0; row1<noOfRow; row1++)
    {
        NSLog(@"Row is %d",row1);

        path = [NSIndexPath indexPathForRow:row1 inSection:0];

        Input_Details *inputDetailsObject1=[[self sortInputs] objectAtIndex:path.row];
        /*
          Update the input details from the values in the text fields.
        */
        EditingTableViewCell *cell;

        cell = (EditingTableViewCell *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:row1 inSection:0]];
        inputDetailsObject1.mh_Up= cell.cell_MH_up.text;
        inputDetailsObject1.mh_down=cell.textField.text;
        NSLog(@"Saving the MH_up value %@ is saved in save at index path %d",inputDetailsObject1.mh_Up,row1);

        [masterController saveContext];
    }
    [self.tableView reloadData];
}

My problem is that the code is not helping in saving the data. Plz help.
Thanks

  • 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-06-10T10:39:25+00:00Added an answer on June 10, 2026 at 10:39 am

    You try to use the table view cells as a data source, which will not work (apart from being a bad design). The problem is that

    [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:row1 inSection:0]]
    

    returns nil if the cell at that row is currently not visible. (A table view allocates only cells for the visible rows and reuses these cells as you scroll up or down.)

    You have to track changes to the text fields immediately, e.g. by implementing a textFieldDidEndEditing: delegate function, and store the changed text in your data source.

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

Sidebar

Related Questions

I have created a WinForms user control that is a set of five cascading
I have created tab bar programmatically in the view controller. In my application, Initially
I created a table with five columns dynamically. Two (the second and third column)
i have a datatable i created below i need to list all rows' cell
I have a simple mysql table with five columns: id: auto_increment (primary) id_symbol: INT(4)
I have a table with data : id one two three four five six
I am developing an android application in which i have created five tabs and
I have a table with five fields, | Zip code | Data 1 |
I have created a flash with five movie clips. I want when I press
I have created an application which stores a set five different times, at each

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.