On 28/05/2009, at 2:34 PM, Grant Erickson wrote:

is it best to have a NIB for each subview or pack them all into
a single NIB?


I'd say put all the subviews into the same nib. It makes it much easier to select among them because you can have a single master controller that has outlets for each subcontroller. You can also instantiate each subcontroller in the nib and connect up all the individual controls for each subview.

Switching them in and out could be done with a tabless tabview, but it's also very easy to write code that inserts and removes the subviews. This code can be made generic and not requiring modification if you add further types of subview by choosing a naming convention for your outlets and taking advantage of valueForKey:'s ability to discover ivars by name.

KVO and bindings can further reduce the code needed to implement the view/controller handling. With care it can be boiled down to just a few lines of code.

--Graham




_______________________________________________

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

Reply via email to