Skip navigation.
 
mlRe: NSDocumentController singleton problem, part 2
FROM : matt neuburg
DATE : Tue Dec 17 19:01:47 2002

On Mon, 16 Dec 2002 00:42:33 -0600, Brad Oliver <<email_removed>> said:

>I've got an app for which I need to have at most one
>document open at a time. Per some prior suggestions, I've
>tried variations on hacking my NSDocument subclass and
>also an NSDocumentController subclass.
>
>In a nutshell, I can't get it to work 100%. By overriding
>NSDocumentController, I can get my app to Do The Right
>Thing, but with one major caveat: it puts up an error
>message (spawned somewhere in AppKit) about how it can't
>create a new document, due most likely to the fact that I
>return NULL in my openUntitledDocumentOfType, etc methods.
>
>Can someone suggest a better way to do this?


I would suggest that you not use the document architecture in the first place. If you can only have one document open at a time you're not really doing documents, so what do you need it for? See the TextEdit code (on your hard disk) or the simpler example in the ABY Cocoa book and take it from there. m.

matt neuburg, phd = <email_removed>, http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlNSDocumentController singleton problem, part 2 Brad Oliver Dec 16, 07:42
mlRe: NSDocumentController singleton problem, part 2 matt neuburg Dec 17, 19:01
mlRe: NSDocumentController singleton problem, part 2 Brad Oliver Dec 17, 22:58
mlRe: NSDocumentController singleton problem, part 2 matt neuburg Dec 18, 18:49
mlRe: NSDocumentController singleton problem, part 2 Brad Oliver Dec 18, 20:36
mlRe: NSDocumentController singleton problem, part 2 matt neuburg Dec 19, 17:57
mlRe: NSDocumentController singleton problem, part 2 Brad Oliver Dec 19, 19:18
mlRe: NSDocumentController singleton problem, part 2 Mike Ferris Dec 20, 18:59
mlRe: NSDocumentController singleton problem, part 2 Brad Oliver Jan 3, 22:29