I already have a tableView with data in it. IF you tap a cell/row it pushes to an edit type of view. Is there anyway to edit core data’s data other than: By edit, i mean i already have data inserted into my context. I have loaded my data into my view, the user can change the existing data, and re save it.
.h
//Below is the entity/entity’s class name ‘Amm’
Amm *amm;
.m
-(IBAction)save
{
[self.amm setValue:self.nameField.text forKey:@"name"];
[self.amm setValue:self.nicknameField.text forKey:@"nickname"];
[self.navigationController popViewControllerAnimated:YES];
NSError *error;
if (![self.managedObjectContext save:&error]) {
//Handle Error
}
}
I want this code to work, however the design pattern of my app isnt allowing this code to work for me as it does in other parts of my app. Thank you very much for any and all help!
I assume from what you’ve said you have:
What’s the actual issue? I’m assuming when you tap save that:
Is that right? If so perhaps try the following code to set the managed object values:
If that’s not the issue and you are actually setting the managed object values properly, is it that you just need to refresh the table-view? Perhaps use some NSLog commands to log every step of the applications progress.