Re: NSDocument setFileName - File Must Exist?
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