Q:

How to load second view in Preference window cocoa

I am developing a cocoa application for mac.  I have created a preference window with four buttons in toolbar.  I am loading views on click event of buttons.  Its working fine. 
What I want to know is how to load another view on click of button in a view.  Like in preference window of Safari, there is tab named with Privacy.  And there is a button 'Details...' in Privacy tab.  When we click on that button it shows a new view which shows a list of cookies. 
Any Idea how to load view like view loaded on click of 'Details...' button??? 

A:

There are several approaches, depending on what you're trying to accomplish.  The easiest is probably to create the view you want, but make it hidden when you don't want it to be visible.  Then when the user presses the "Details…" button, make it visible (and possibly expand the window if necessary) by calling [-NSView setHidden:NO]. 
Another way is to make the view a separate view in your .nib file, and when the "Details…" button is pressed, insert the view into the appropriate window using [-NSView addSubView:]. 
You could also create the view at runtime when the user presses the "Details…" button.  That seems like a lot of work, though.