Skip navigation.
 
mlDesign patterns
FROM : Trygve Inda
DATE : Sun Jul 23 13:46:31 2006

I am wondering what the general consensus is on handling sheets. I currently
have two simple sheets managed by my AppController which require a few
methods:

- (IBAction)showPluginWindow:(id)sender
- (void)pluginTableDoubleClick:(id)sender
- (IBAction)okButtonAction:(id)sender
- (IBAction)cancelButtonAction:(id)sender
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode
contextInfo:(void *)contextInfo

I have similar methods for a prefs sheet. Should these be put into separate
objects?

Both sheets act upon data that the main app needs to know about, although
with the prefs sheet I have a dict in my main app that just has a series of
keys for the user preferences.

The sheets are stored in my main nib file. Is there any advantage to moving
them to their own nib and making the separate objects?

If I had a complex window that really needed a window Controller, I would
use a different nib and make it an object, but for relatively simple sheets
with a few controls, what do the masses think?

I guess some of this leads to... How many methods in a class is reasonable
and is there any way (good idea?) to move some of them into a separate
source file. (Can, or is it normal for a class have more then one .m file?)

Thanks,

Trygve

Related mailsAuthorDate
mlDesign patterns Trygve Inda Jul 23, 13:46
mlRe: Design patterns Mike Abdullah Jul 23, 18:52