So I'm trying to play around with WebKit and create my own browser. However, now I'm kind of stuck where I can't hide the save panel when I try to close my window. I can't find any method in the NSDocument reference that hides the panel. Does anyone know how I can solve that? Thanks.
Asked
Active
Viewed 159 times
1 Answers
0
I'd have to say that NSDocument
is a slightly odd choice for a browser app. The Cocoa document architecture is really designed for editor-type applications that load and save files from disk, whereas there is no real concept of a "document" in a browser.
Why not just implement a main controller that manages a bunch of window controllers? What does the document architecture give you that you feel your app needs?

Rob Keniger
- 45,830
- 6
- 101
- 134
-
Thanks for the quick reply. I have tried looked into that before, but that seems a bit more complicated than the NSDocument way. Do you know any sites that can teach that? – TheAmateurProgrammer Aug 23 '11 at 00:41
-
1Well, you just need to implement a subclass of `NSWindowController` that manages your browser window. Then you would have some main controller class that manages an `NSMutableArray` containing instances of your `NSWindowController` subclass. Your main controller can respond to menu items like "New Window" by instantiating new instances of the window controller and displaying their windows. – Rob Keniger Aug 23 '11 at 08:12