I am not sure about this, but does setting a core data object to nil, deletes it from Core Data. For Example:
MyObject *obj = [MyObject fetchFromCoreDataWithID:objectID];
obj = nil;
Does this deletes that object from Core Data ?
No. The object is only a representation of what is in your CoreData store. If you want to delete the object you must do this:
NSError *saveError = nil;
[_managedObjectContext deleteObject:obj];
[_managedObjectContext save:&saveError];
No.
You need to do the following to delete it:
[managedObjectContext deleteObject:obj]
See the documentation for more detail.
You can also create your NSManagedObject
without adding it to NSManagedObjectContext
. Then you don't need to delete it at all. See this for more details: Inserting a new managed object in Core Data.