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

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -