tciuro / NanoStore

NanoStore is an open source, lightweight schema-less local key-value document store written in Objective-C for Mac OS X and iOS.
Other
404 stars 39 forks source link

Add a saved? method #100

Closed kidbombay closed 10 years ago

kidbombay commented 10 years ago

i want to know if the object is saved in the db at all. Useful for forms.

tciuro commented 10 years ago

Hi Ketan,

So basically implement the following property in NSFObject:

/** * To determine whether the object has uncommited changes.  */
@property (nonatomic, readonly) BOOL hasUnsavedChanges;

Is this what you need?

kidbombay commented 10 years ago

Yes, I use this through https://github.com/siuying/NanoStoreInMotion so I'm not sure if it goes on NanoModel or NSFObject but as long as it's clear on the instance level if the model is dirty that would be excellent.

tciuro commented 10 years ago

If it's offered by NanoStore then it'll be available also in NanoStoreInMotion. I think it makes sense to add it to NanoStore.