Q:

iPhone Core Data - How to remove NSManagedObject from context?

CustomManagedObject *newObject = (CustomManagedObject *)[NSEntityDescription insertNewObjectForEntityForName:@"Substation" inManagedObjectContext:[[DatabaseHelper instance] context]];

I make a new object, using the line above. However sometimes i dont want to save that object to permanent data store, i just want to remove it from context. Is there some kind of method like removeObject: object fromContext: context?

A:

Did you check the documentation? The method is called deleteObject:
[[[DatabaseHelper instance] context] deleteObject:newObject]; 

