And now for my next question(s)...
And now for my next question(s)...
- Subject: And now for my next question(s)...
- From: Simon Stapleton <email@hidden>
- Date: Fri, 6 Jul 2001 09:22:27 +0100
Hi.
Thanks for those who've answered my previous questions. I think my
understanding of the event system has now 'clicked' - I managed to add
another 6 perfectly working controls to the main window of my app in 10
minutes last night - and that bit's done. Yay Cocoa!
However...
My app will have another 6 views on specific parts of the document -
these views will share much processing. For example, each view will
live in a similar window with identical buttons and handling of those
buttons - as a result, I have a nib file which contains the window
layout, buttons, and an NSView to hold the content. I also have a
windowcontroller which handles the button behaviour. I figure what I
should do now is either subclass the windowcontroller to handle the
separate windows or use categories for this. I should then generate nib
files for the embedded component views, contain all the controls nested
in a view within that nib, and then somehow 'extract' that view and
replace the view in the higher level window with it.
So.
Is there a preference for subclassing or categorising - either would
work, in my view.
How does one extract a view from a nib file?
What should I use to handle events from the nested subview? A separate
windowcontroller class? an NSView subclass? The higher level
windowcontroller?
Am I making sense?
Thanks in advance.
Simon