Newbie Q : automatic creating & saving
Newbie Q : automatic creating & saving
- Subject: Newbie Q : automatic creating & saving
- From: email@hidden
- Date: Sat, 27 May 2006 21:46:27 +0200 (CEST)
- Importance: Normal
Hello all,
I've built an NSDocument-based ``uneditable" application (the main window
just displays the results of some computations in a table view, and
the computations go one step further when the user clicks on a certain
button). There are two features I should like to put in this application :
-1) automatic naming and location when a document is first opened (instead
of beginning with an "Untitled" document that will ask the user where to put
the file at closetime, it should start with an already titled document in a
fixed location, without asking the user anything).
-2) The document saves itself automatically if the user closes it or
quits the
application.
For 1) I added the following line in the windowControllerDidLoadNib:
method in
MyDocument.m :
[self setFileURL : [NSURL fileURLWithPath :
@"/Users/ewan/Desktop/PrimesProgram"]];
It doesn't work very well : after the application has launched I get a
sheet with
"The location of document ``PrimesProgram" cannot be determined. You can
specify where to save it" on it.
I've no idea where to start for 2). The -close method in MyDocument
cannot be
overriden, can it ?
What would the right way to do this in Cocoa ?
Thanks in advance.
Ewan
_______________________________________________
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