• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Automatic saving with NSDocument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Creating balloon type of window in Cocoa
  • Next by Date: Getting restart, shutdown, logout notification
  • Previous by thread: Core Data back-end daemon [was re:Core Data File Sharing via an AFP Alias]
  • Next by thread: Getting restart, shutdown, logout notification
  • Index(es):
    • Date
    • Thread