I have a Mac app that needs to be based on multiple modules. That is, a single window with multiple views, and the default view with a menu. That menu should open one module on the default window and then if I select another module, the contents of the window should change with another view. Those views also have different states, so I made multiple views for each module.
In a nutshell, my app is a single AppDelegate.h/.m
, a single xib file, with one NSWindow
object and multiple NSView
views. Those views have different states, so I load different other related NSView
s.
To load a view, I use [window setContentView:viewNameView];
which I know that causes the old NSView to lose state, so I need to keep them all in memory for each module.
Is this the right approach?
Thank you!