• 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
Re: -saveDocument: and package problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -saveDocument: and package problems


  • Subject: Re: -saveDocument: and package problems
  • From: Keith Blount <email@hidden>
  • Date: Tue, 19 Feb 2008 11:28:30 -0800 (PST)

Hi James, many thanks for your replies, much appreciated. Actually, I'm not too worried about the auto-save, as that isn't the problem with data loss. Even if auto-save fails during a sleep, the user can manually save and auto-save will kick in again as soon as they start using the app provided the project has an internal -hasChanges flag set.

More investigation seems to indicate that somehow, an empty project folder is being created that wipes out the existing project folder. So, anything that is open in the app - the current text document and the source list - get saved into the empty project that has just wiped out the full one. I reproduced this by creating a folder in the Finder with the same name as my project file and then replacing the project file whilst it was open. This had exactly the same effect as the sort of data loss my users have reported.

The trouble is, I don't know why this would happen other than the user choosing to do it. The obvious answer would be something in my code - an erroneous call to -createDirectoryAtPath:handler: or writeToFile:..., accidentally passing in the project path instead of the subpath, but I've been through my code and can't find anything that would do this.

Given that I've overridden -saveDocument:, I can't imagine there being anywhere else (internal to NSDocument) that could save an empty package over the file path, but I could be wrong... Weird.

Thanks again and all the best,
Keith



      ____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: *** -[NSCFDictionary setObject:forKey:]: mutating method sent to immutable object
  • Next by Date: Re: Accessing buffers in NSData/NSMutableData under garbage collection
  • Previous by thread: Re: -saveDocument: and package problems
  • Next by thread: Re: -saveDocument: and package problems
  • Index(es):
    • Date
    • Thread