Note that there are some explanatory texts on larger screens.

plurals
  1. POTrying to save data in Core Data from UITableViewController textbox
    primarykey
    data
    text
    <p>I have a Table view controller with 5 textboxes in a row which are added with null values when we click on add button.</p> <p>I am trying to save the data in a database via Core Data.</p> <p>My problem is that when I click in the text box and finish putting the value and via a touch screen when i am trying to put the data the cursor goes to the other text box but do not allow me to enter text until I press the Return key on the keyboard.</p> <p>Here is my coding for the text box:</p> <p>-(void)textFieldDidEndEditing:(UITextField *)textField</p> <pre><code>{ row1=textField.tag; NSLog(@"Row is %d",row1); path = [NSIndexPath indexPathForRow:row1 inSection:0]; Input_Details *inputDetailsObject1=[self.fetchedResultsController objectAtIndexPath:path]; /* Update the Input Values 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.cell_MH_dn.text; inputDetailsObject1.sewer_No=[NSNumber numberWithInt:[cell.cell_Sewer_No.text intValue]]; inputDetailsObject1.mhup_gl=[NSNumber numberWithFloat:[cell.cell_gl_MHUP.text floatValue]]; inputDetailsObject1.mhdn_gl=[NSNumber numberWithFloat:[cell.cell_gl_MHDN.text floatValue]]; inputDetailsObject1.pop_Ln=[NSNumber numberWithInt:[cell.cell_Line_pop.text intValue]]; inputDetailsObject1.sew_len=[NSNumber numberWithFloat:[cell.cell_Sewer_len.text floatValue]]; [self saveContext]; [textField resignFirstResponder]; NSLog(@"Saving the MH_up value %@ is saved in save at index path %d",inputDetailsObject1.mh_Up,row1); } -(void)saveContext { NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; NSError *error = nil; if (![context save:&amp;error]) { NSLog(@"Unresolved error %@, %@", error, [error userInfo]); abort(); } } </code></pre> <p><a href="http://i.stack.imgur.com/KuYMD.png" rel="nofollow">Here is a picture</a> of the table view and text boxes.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload