How to make a Core Data Entity immutable?

Is there a best practice for making an entity immutable? Users create exercises in my app and some would like a means to 'lock' a file when it is complete. It seems ridiculous to add a 'locked' property and check that whenever a property is set, but is that 'the way' to do it?

Answers


Actually, adding a locked / immutable property is a perfectly adequate solution. I recently used such a scheme, using a locked NSDate property. So I know when the entity was locked.

As far as I know, there is no such thing in Core Data itself.

By the way, a locking scheme in Core Data itself would be quite complex, as relationships are involved. What if an entity part of a relationship of a locked entity is deleted? The delete is denied? Or the relationships are mutable even when the entity is not? There is no universal answer I think.


Need Your Help

how to show selection of the lst item in recycler view in android?

java android android-layout android-5.0-lollipop android-recyclerview

I have implemented the recycler view in navigation drawer in android.This is working fine.I am able to switch between item by clicking on recycler view item.

Generate Input for a different application

java testing

I need to programmatically generate a mouseclick within Java code for a different application running on the same Win7 machine. The process is already known (Pointer to Process). Is there an API or...