• 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
Remember last saved file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Remember last saved file


  • Subject: Remember last saved file
  • From: Neto <email@hidden>
  • Date: Fri, 9 Jun 2006 01:58:48 -0300

Hi all,

I'm using this to make my application remember the last saved file:

- (BOOL)writeToURL:(NSURL *)absoluteURL
           ofType:(NSString *)typeName
  forSaveOperation:(NSSaveOperationType)saveOperation
originalContentsURL:(NSURL *)absoluteOriginalContentsURL
            error:(NSError **)error
{
   [[[NSUserDefaultsController sharedUserDefaultsController] values]
setValue: [NSArchiver archivedDataWithRootObject:
absoluteOriginalContentsURL] forKey:@"lastFileURL"];
   return [super writeToURL: absoluteURL
                     ofType: typeName
           forSaveOperation: saveOperation
        originalContentsURL: absoluteOriginalContentsURL
                     error: error];
}

The problem is it only works if the user SAVE. It is not working for SAVE AS...

Any tips?

neto


_______________________________________________ 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
References: 
 >NSView+NSDrawer+nextKeyView (From: Neto <email@hidden>)
 >Re: NSView+NSDrawer+nextKeyView (From: Neto <email@hidden>)
 >Remember last saved file (From: Neto <email@hidden>)

  • Prev by Date: Open safari and send post variables
  • Next by Date: Re: Open safari and send post variables
  • Previous by thread: Re: Remember last saved file
  • Next by thread: Can NSMailDelivery be configured programmatically?
  • Index(es):
    • Date
    • Thread