Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

goodrunb

macrumors newbie
Original poster
Apr 13, 2009
22
0
Ok, So A friend has an app, and I am helping program it for him.

He has an app that is quartz composer based, but that has nothing to do with what I'm trying to accomplish.

So He has a view when the app first opens. I created a drop down menu to open another view, but when it switches to that view both of the views are still there. I want to know how to make it to where when it switches to the 2nd view the first one closes. Also there is 6 views in all. I want to make it to where he can switch to any one view and the previous one he was viewing would close.

Also, how do i make it to where when it switches to another view, in the dropdown menu it has a little tick by the view. I want to know how to make it tick based on which view is active.


Ok thanks and I need help urgent! THANKS :D :apple::apple::apple::apple::apple::apple::apple::apple::apple::apple::apple::apple:
 
Assuming you're doing this in Xcode/IB, do you know any Cocoa? IB can let you display Quartz Composer views without any code, but what you want to do requires actual programming.
 
Assuming you're doing this in Xcode/IB, do you know any Cocoa? IB can let you display Quartz Composer views without any code, but what you want to do requires actual programming.


I know the very basics of cocoa, but nothing more.

And as far as IB, quartz composition picker doesn't require any code?
 
If you are using NSView objects, you should be able attach all of the ones you want right where you want them (in a superview, such the window's content view) and simply use the method -setHidden: to toggle amongst them. According to the documentation, when a view is hidden, it is removed from the responder chain, but continues to receive resizing messages, according to its auto-resize mode. This is probably the simplest, fastest way to do what you want.
 
If you are using NSView objects, you should be able attach all of the ones you want right where you want them (in a superview, such the window's content view) and simply use the method -setHidden: to toggle amongst them. According to the documentation, when a view is hidden, it is removed from the responder chain, but continues to receive resizing messages, according to its auto-resize mode. This is probably the simplest, fastest way to do what you want.

Just to extend this point a bit. You need an object that will act as the controller for those views (think "C" in MVC). Each view may have it's own view controller, but the superview's window controller should be managing the the creation/destruction, hiding/showing of it's subviews. Take a look at the Apple Docs on the view hierarchy.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.