Automatic saving with NSDocument
Automatic saving with NSDocument
- Subject: Automatic saving with NSDocument
- From: "Ewan Delanoy" <email@hidden>
- Date: Sat, 16 Jun 2007 10:50:28 +0200 (CEST)
- Importance: Normal
Hello all,
in my NSDocument-based Cocoa project the main "model" class
has two types of ivars:
1) Those whose latest modification is to be saved only if the user asks
for it.
2) Those whose latest modification is saved immediately and automatically.
Of course, the usual way to do it is to use ivars of type 1, using
NSChangeCount. What is not clear to me is how to implement this "automatic
saving" for ivars of type 2). I'm been thinking of something like :
// this is code in the NSDocument subclass ; here x is a "type 2" ivar
-(IBAction) setX: (id) sender
{
x=[sender value];
[self saveDocumentTo:nil];
}
Is there a better way to do it ?
Ewan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden