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.
It would be great to have separate overloadable public methods similar to -didLoadFromDocument for the three cases of:
model being created with document.
change tracker induced change to a model object.
a failed save of a model object.
Currently all three cases result in -didLoadFromDocument: being sent to the CouchModel object affected. This is because the method -didLoadFromDocument is called by both -initWithDocument: and by -couchDocumentChanged:, which in turn is called by -CouchDocument's -notifyChanged: and the error case in CouchModel's -saveCompleted:
The text was updated successfully, but these errors were encountered:
Looks like overloading -couchDocumentChanged: in a CouchModel subclass makes it respond to only the cases 2 and 3 noted above. Something on these lines:
(void)couchDocumentChanged:(CouchDocument *)doc
{
// couchDocumentChanged: not declared as a public method for CouchModel so need to performSelector: it
if ([super respondsToSelector:@selector(couchDocumentChanged:)])
[super performSelector:@selector(couchDocumentChanged:) withObject:doc];
// do stuff in response to a change tracker induced change, or a failed model object save
}
Is there some way to get a response to only a change tracker induced change (isolate cases 2 and 3 from each other)?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It would be great to have separate overloadable public methods similar to -didLoadFromDocument for the three cases of:
Currently all three cases result in -didLoadFromDocument: being sent to the CouchModel object affected. This is because the method -didLoadFromDocument is called by both -initWithDocument: and by -couchDocumentChanged:, which in turn is called by -CouchDocument's -notifyChanged: and the error case in CouchModel's -saveCompleted:
The text was updated successfully, but these errors were encountered: