> > On 07/02/2010, at 3:52 PM, Trygve Inda wrote: > >> The checkboxes window is in is own nib > [] > >> Any drawback to this? >> >> It seems like overkill to create a custom class to manage the checkbox >> window when all the checkboxes are controlled by bindings and there is only >> an OK/Cancel button. >> >> Any thoughts on a design pattern for this situation? > > > The drawback is that by putting it into a separate nib you've made a simple > situation a lot more complex. > > Why not just but the checkbox window in the same nib as the one where the > table view is? Unless you intend to use the checkbox window for several > different unrelated situations, it may as well be in the same nib, since it is > really part of the same interface, albeit an auxiliary part of it. Then, you > can also instantiate its window controller in the same nib and hook the whole > thing together to an outlet in the tableview's controller. The actual window > won't be made until it's first used, and the rest of it is a very small > overhead indeed in both time to load and memory use. It will be well worth it > in terms of making the whole thing far easier to code. > > --Graham
So it's window controller would just be a plain NSWindowController (no subclass) and in my TableController id just do: returnCode = [NSApp runModalForWindow:[theWindController window]]; I'd have to do the same with one other similar window (a window to set a multi-value search predicate). Best to keep this in the same nib too? My Prefs window I think would be in a separate Nib with its own controller as it's more complex, but for the two simple (checkbox/predicate) windows, I don't think they need controller subclasses. I haven't really done a project quite like this before and in the past I have used a separate nib for each window. Trygve _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com