malaba
malaba

Reputation: 654

newbie: multi-window (not Document based), is this design sound?

I'm a newbie and wanted to know if I'm on a relatively correct path.

I have a CoreData application, but not Document based (it's not a document but a central DB with many window/view possible).

Two type of window exist (B and T) to view different aspect of the data.

Since it's possible to open many B or T windows simultaneously (to show different part of the same aspect) I decided to create two subclass of NSWindowController (B_Controller, T_Controller) each with his own nib file (B.xib, T.xib).

In my AppDelegate, whenever some menu/shortcut is activated I allocate the corresponding controller, initWithWindowNibName:, show the window and enabled the File->Close menu.

Questions:

Upvotes: 1

Views: 151

Answers (1)

malaba
malaba

Reputation: 654

vague newbie question. Maybe this response:

  • NSWindowController is for one window only.
  • if you want a central place for all window use your AppDelegate.
  • if you want a central place for all window of some kind, create new class to do just that.

Upvotes: 1

Related Questions