ios - Editing data in a CoreData application -
i have application 4 view, main view view contain table view data, in view have 1 button add button add new data, if click on row have detailview , in view have button , if click have editview, want change data, when type data can't save that. code
-(void)save { [self.ricettadamodificare setvalue:self.titoloricetta.text forkey:@"name"]; [self.ricettadamodificare setvalue:self.ingredientiricetta.text forkey:@"ingredient"]; [self.ricettadamodificare setvalue:self.preparazionericetta.text forkey:@"make"]; }
i know must pass context when? thanks
you need call save on managed object context after have updated database objects:
-(void)save { [self.ricettadamodificare setvalue:self.titoloricetta.text forkey:@"name"]; [self.ricettadamodificare setvalue:self.ingredientiricetta.text forkey:@"ingredient"]; [self.ricettadamodificare setvalue:self.preparazionericetta.text forkey:@"make"]; nserror *error; [self.managedobjectcontext save:&error]; if (error) // handle save error }
Comments
Post a Comment