Re: customizing save behavior in doc based apps
Re: customizing save behavior in doc based apps
- Subject: Re: customizing save behavior in doc based apps
- From: Uli Kusterer <email@hidden>
- Date: Mon, 26 Dec 2005 22:33:21 +0100
Am 26.12.2005 um 22:08 schrieb Jim Correia:
If you really want to save after every set of changes, listen to
the notifications designed for that purpose. An override of -
updateChangeCount: or listening for
NSManagedObjectContextObjectsDidChangeNotification both seem like
more appropriate solutions.
In addition to that, you may want to not save on every change. You
could do that by setting up one-shot a timer that will trigger a save
in 3 seconds, then remove itself. Whenever a new change happens and
the timer is still pending (i.e. has been installed but hasn't yet
fired) you simply reschedule it to fire, say, 3 seconds from *that*
point in time. That way, while the user is busy changing stuff, the
timer will silently be pushed back. As soon as the user makes a short
pause (i.e. doesn't do anything for three seconds) the changes will
be written to disk.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden