Skip to content

Instantly share code, notes, and snippets.

@mactive
Created March 13, 2013 10:15
Show Gist options
  • Save mactive/5150822 to your computer and use it in GitHub Desktop.
Save mactive/5150822 to your computer and use it in GitHub Desktop.
想利用一个Coredata 的Model 但又不想写入数据库
//http://stackoverflow.com/questions/3868514/is-there-a-way-to-instantiate-a-nsmanagedobject-without-inserting-it
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Transaction" inManagedObjectContext:self.managedObjectContext];
transaction = (Transaction *)[[NSManagedObject alloc] initWithEntity:entity insertIntoManagedObjectContext:nil];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment