views:

540

answers:

3

It seems like there is a lot of online information regarding switching between views in Cocoa Touch, but not that many in "desktop" Cocoa. For an app I am creating, I am wondering the pros/cons of the methods (and please list the methods if you could), and which one people personally use/suggest. I don't think that using an invisible border NSTabView will do the trick for this specific app, but I value all your options. I will be changing the view with some buttons at the side as show in iPhoto, iTunes, and generally most Mac apps out there.

Thanks for any help.

EDIT: I have looked into using NSViewController, but am wondering what advice anyone has about how to use this/why not to use this.

+1  A: 

Check out Brandon Walkin's excellent BWToolkit

Dave DeLong
@Dave DeLong As it happens, I'm actually using this toolkit for my project. Does this allow view switching, and if so where can I learn about it?
PF1
IIRC, BWToolbar allows you to build the views and switch between them in IB. Then *I think* you can just hide the toolbar through code when you actually run, and switch programmatically (if that's what you're going for)
Dave DeLong
@DaveI'll take a look into this. But, in case it doesn't work, would you have an alternative suggestion?
PF1
A: 

NSViewController will work fine. I've used it for a very similar situation without any problems.

Tom Dalling
+2  A: 

Cathy Shive has created a framework called KTUIKit which was designed with single window applications modeled after iPhoto/iTunes/etc. The KTTabViewController class in particular may be of interest, as it provides a way of switching between an arbitrary number of subviews. They provide a formal way of dealing with nesting views, keeping the responder chain intact, and keeping various notifications properly observed/unobserved. There are also a series of blog posts describing some of the reasoning behind the design and how the classes work (the blog posts refer to them with an "XS" prefix instead of "KT", but they're basically the same thing).

Brian Webster