objective c - Save NSManaged object with UITextField Changes -


is save core data whenever edit made uitextfield.

-(void) viewdidload{     [super viewdidload];     [namefield addtarget:self action:@selector(textfieldvaluechanged:) forcontrolevents:uicontroleventeditingchanged];     [yearfield addtarget:self action:@selector(textfieldvaluechanged:) forcontrolevents:uicontroleventeditingchanged]; }   -(void) textfieldvaluechanged:(uitextfield*) field{     nsindexpath *path=[self geteditingindexpath];     car *carobject=[fetchcontroller objectatindexpath:path];     switch (field.tag) {         case 1:             carobject.name=field.text;             break;         case 2:             carobject.year=[field.text intvalue];             break;         default:             break;     }    nserror *e;    [managedcontext save:&e]; } 

the idea behind approach eliminate "save" button.

so, better approach flow helpful.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -