• 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: Lion - opening files as a viewer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lion - opening files as a viewer


  • Subject: Re: Lion - opening files as a viewer
  • From: Seth Willits <email@hidden>
  • Date: Sat, 03 Mar 2012 21:08:32 -0800

On Mar 3, 2012, at 8:23 PM, Graham Cox wrote:

> … Unfortunately on Lion, the autosave feature overwrites the original file, destroying it, and replacing it with our native format, but with the wrong extension (it has the original extension).
>
> Shouldn't setting the role to 'viewer' prevent this?

Based on my understand of CFBundleTypeRole, it should definitely not autosave on top of the original file. Sounds like a bug to me too.



> Otherwise what should I be doing to avoid this annoying problem?

I don't have a solution for you, but I *thought* that NSDocumentController's new makeDocumentForURL:withContentsOfURL:ofType:error:, passing nil for the first parameter would have been a solution. It turns out that as soon as the document is closed, the original file is deleted. Not that it's documented *anywhere* that it does that. If it didn't delete the original contents url, this method would have been a perfect way to implement the behavior you want, and would have been good for my case as well. Le sigh.



--
Seth Willits
_______________________________________________

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


References: 
 >Lion - opening files as a viewer (From: Graham Cox <email@hidden>)

  • Prev by Date: Running SMJobBless causes kSMErrorDomainFramework error
  • Next by Date: Debugging: Take control of another process (gdb-i386-apple-darwin)
  • Previous by thread: Lion - opening files as a viewer
  • Next by thread: Running SMJobBless causes kSMErrorDomainFramework error
  • Index(es):
    • Date
    • Thread