Created
April 27, 2011 01:49
-
-
Save ajmaradiaga/943582 to your computer and use it in GitHub Desktop.
Instance a NSManagedObject without inserting in ManagedObjectContext
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Assuming Accounts = Name of the Entity to instance | |
BlipAppDelegate *_appDelegate = (BlipAppDelegate *)[[UIApplication sharedApplication] delegate]; | |
NSManagedObjectContext *MOC = [_appDelegate managedObjectContext]; | |
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Accounts" inManagedObjectContext:MOC]; | |
Accounts *account = (Accounts *)[[NSManagedObject alloc] initWithEntity:entity insertIntoManagedObjectContext:nil]; | |
//Insert data to account |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment