Reputation: 727
I would like to have a detail view come in to focus when the user double clicks on a table view row. How would I change a window's view in code?
Upvotes: 3
Views: 5842
Reputation: 119184
The basic idea would be as follows:
- (IBAction)tableViewDoubleClicked
{
...
[window setContentView:myDetailView];
}
Note that this may release the view that was previously used as the contentView
for the window, so if you are planning to swap around a couple of different content views, you will need to properly retain them elsewhere.
See Apple's documentation for more details.
Upvotes: 9