Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 737 Bytes

Deleting-Entities.md

File metadata and controls

51 lines (37 loc) · 737 Bytes

Deleting Entities

To delete a single entity in the default context:

// Objective-C
[myPerson MR_deleteEntity];
// Swift
myPerson.mr_deleteEntity()

To delete the entity from a specific context:

// Objective-C
[myPerson MR_deleteEntityInContext:otherContext];
// Swift
myPerson.mr_deleteEntity(in: otherContext)

To truncate all entities from the default context:

// Objective-C
[Person MR_truncateAll];
// Swift
Person.mr_truncateAll()

To truncate all entities in a specific context:

// Objective-C
[Person MR_truncateAllInContext:otherContext];
// Swift
Person.mr_truncateAll(in: otherContext)