You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.
If the CouchModel is set up to autosave and it is dealloc'ed before the save timer hits it, changes are lost. I was making a last change to my model before freeing it. I noticed the changes were not getting PUT into the db. I added this to my subclass' dealloc() and it fixed the problem.
if (self.needsSave && self.autosaves) {
RESTOperation* op = [self save];
[op wait];
}
The text was updated successfully, but these errors were encountered:
This is fixed in Couchbase Lite: the CBLDatabase keeps a set of all CBLModels that have unsaved changes. This keeps them from being dealloced unsaved, and also enables a save-all-models method.
It might be worthwhile to backport this. I'm not likely to make any significant changes to CouchCocoa on my own, though.
If the CouchModel is set up to autosave and it is dealloc'ed before the save timer hits it, changes are lost. I was making a last change to my model before freeing it. I noticed the changes were not getting PUT into the db. I added this to my subclass' dealloc() and it fixed the problem.
The text was updated successfully, but these errors were encountered: