• 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
NSDocument Save As... problem?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDocument Save As... problem?


  • Subject: NSDocument Save As... problem?
  • From: Graham Cox <email@hidden>
  • Date: Tue, 03 Feb 2015 09:06:53 +1100

If my NSDocument subclass opens a file of a certain type, and then I do a Save As (option click the File menu), choose a new name and CHANGE THE EXTENSION, shouldn't the document be given the new typeName in -fileWrapperOfType:error: ?

I'm finding that it is passed the original typeName, so the file gets saved using the data format of the original file, but end up on disk with the extension that I gave it in the Save dialog. The mismatch between the data content/format and the extension then confuses NSDocument on subsequent attempts to open the file, so it reports that the document cannot be opened.

One of two things seems wrong: either a) the Save As dialog should not permit the extension to be changed, or ) the document should be being passed the typeName corresponding to the extension I entered. Or is there a step I'm missing somewhere that my document subclass should be doing to allow the extension to be changed?

--Graham



_______________________________________________

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


  • Follow-Ups:
    • Re: NSDocument Save As... problem?
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Core Data concurrency during import of folder contents
  • Next by Date: Re: Extrange problem with screensaver in 2 monitors and key stroke
  • Previous by thread: Re: Core Data concurrency during import of folder contents
  • Next by thread: Re: NSDocument Save As... problem?
  • Index(es):
    • Date
    • Thread