Change detail view from MasterDetail iPad app using storyboard

Vinícius Albino picture Vinícius Albino · Feb 19, 2012 · Viewed 8.9k times · Source

I'm little lost here. I have a basic master-detail aplication, and I want to change the detail view according to the selected row in MasterViewController, but the views have different content, one has an image gallery, and the other one will load a video on full screen. It's not just refresh the detail view, have to load another view. How is the better(fast) way to do that?

Answer

Uko picture Uko · Feb 19, 2012

I'll suggest you to use a replace segue.

Just create a segue to the desired view initiated by your row with a Style: Replace, and Destination: Detail Split.

Segues were introduced in the iOS 5 SDK

EDIT:

These are step-by-step instructions to accomplish what you need. From now on:

  • the item that should be pressed for the action to take place (a button or row in master view) = *Button;
  • the view you want to be placed in the iPad's detail view = *Detail.

just a bit for naming for ease of explanation

  1. Hold ctrl click on *Button then hold and drag to *Detail and release to create your segue.
  2. In the popup pick Replace
  3. Select your segue, open Attributes inspector and set Destination to Detail Split

That's all.

More on segues: http://www.scott-sherwood.com/?p=219