Skip to content

Instantly share code, notes, and snippets.

@yasirmturk
Created November 30, 2011 07:40
Show Gist options
  • Save yasirmturk/1408352 to your computer and use it in GitHub Desktop.
Save yasirmturk/1408352 to your computer and use it in GitHub Desktop.
A generic core data function to save and commit our changes to DB
/*
* We can fetch a record, modify it and then call this save function to save our changes
*/
- (BOOL)saveToDb{
NSError *error = nil;
BOOL returnVal = ( [[self managedObjectContext] save:&error] );
if(error != nil)
NSLog(@"%@", error);
return returnVal;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment