individualtermite
individualtermite

Reputation: 3755

Switch Between Views in Cocoa (not Cocoa Touch)

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.

Upvotes: 1

Views: 1619

Answers (3)

Brian Webster
Brian Webster

Reputation: 12045

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).

Upvotes: 2

Tom Dalling
Tom Dalling

Reputation: 24125

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

Upvotes: 1

Dave DeLong
Dave DeLong

Reputation: 243146

Check out Brandon Walkin's excellent BWToolkit

Upvotes: 1

Related Questions