• 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: NSDocument setFileName - File Must Exist?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocument setFileName - File Must Exist?


  • Subject: Re: NSDocument setFileName - File Must Exist?
  • From: Seth Willits <email@hidden>
  • Date: Wed, 2 Feb 2005 13:11:07 -0800

On Jan 30, 2005, at 10:07 PM, Seth Willits wrote:

In an attempt to replicate a feature similar to Xcode's New Project window, I used NSDocumentController's makeUntitledDocumentOfType: method to create a new document instance, and then used NSDocument setFileName: to specify where the file is located. When the document is asked to save though (with saveDocument) it says it doesn't know where it should save the file to, and then brings up a save dialog which is precisely what I'm trying to prevent.

With a bit of detective work I've figured out that saveDocument "doesn't know" where the file is located because the file set with setFileName doesn't yet exist. If it does already exist, my method works fine. So as a workaround, I can create an empty file first and then subsequent calls to saveDocument won't ask where to save it to, but I'm thinking I'm missing something.

Any ideas?

Is there a better place to ask this question?



Seth Willits
------------------------------------------------------------------------ ---
President and Head Developer of Freak Software - http://www.freaksw.com
REALbasic Guru at ResExcellence - http://www.resexcellence.com/realbasic


"Since any reasonable person would choose a Mac over a PC, Apple's market
share does provide us with an accurate reading of the percentage of
reasonable people in our society."
-- Roger Ebert
------------------------------------------------------------------------ ---


_______________________________________________
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


  • Prev by Date: Re: Method not seeing array as array
  • Next by Date: Re: Method not seeing array as array
  • Previous by thread: Re: Patching, upgrading in the future...
  • Next by thread: Re: NSDocument setFileName - File Must Exist?
  • Index(es):
    • Date
    • Thread