Re: NSDocumentController singleton problem, part 2
Re: NSDocumentController singleton problem, part 2
- Subject: Re: NSDocumentController singleton problem, part 2
- From: matt neuburg <email@hidden>
- Date: Tue, 17 Dec 2002 10:01:47 -0800
On Mon, 16 Dec 2002 00:42:33 -0600, Brad Oliver <email@hidden> 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@hidden,
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@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.