 |
 |
Document based app question
|
 |
|
 |
|
Dedicated MacNNer
Join Date: May 2001
Location: Edinburgh, UK
Status:
Offline
|
|
How do you stop a Cocoa document based app from creating a new document on startup? I am sure the answer is trivial but I cannot seem to find out how this is done.
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
I think there's an NSApplication delegate method you can use.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Jan 2002
Location: Hungary
Status:
Offline
|
|
i want to know this as well, so anyone anything specific? 
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: May 2001
Location: Edinburgh, UK
Status:
Offline
|
|
Originally posted by Angus_D:
<STRONG>I think there's an NSApplication delegate method you can use.</STRONG>
Yeah I think there probably is, its just that I can't find it.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2002
Location: Los Angeles, California
Status:
Offline
|
|
Originally posted by iJed:
<STRONG>
Yeah I think there probably is, its just that I can't find it.</STRONG>
Take a look at Apple's documentation on Application Architecture
I think you want to implement applicationShouldOpenUntitledFile: in your application delegate. If it returns NO then your app won't create a new untitled document at startup. (Or when the user clicks on your dock icon when no windows are open.)
|
|
--
Tim Buchheim
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: May 2001
Location: Edinburgh, UK
Status:
Offline
|
|
Originally posted by Tim Buchheim:
<STRONG>
I think you want to implement applicationShouldOpenUntitledFile: in your application delegate. If it returns NO then your app won't create a new untitled document at startup. (Or when the user clicks on your dock icon when no windows are open.)</STRONG>
Thanks for the help. Works nicely. Although I should really have seen this myself. I'll blame the Apple Help Viewer which seems to lack a find function for some strange reason...
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Jan 2002
Location: Hungary
Status:
Offline
|
|
yeah, the apple developer documentation certainly needs a search feature.... 
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |