Quick split-screen question

Discussion in 'iOS Programming' started by pinsrw, Nov 3, 2010.

  1. pinsrw macrumors regular

    Joined:
    May 30, 2010
    #1
    Hi all,

    After some searching I didn't find the answer: In a split-screen app for the iPad, I want to use a number of different detail views, preferably that I design in IB and load on the fly. What method is invoked to set the detail view?

    My impression is that if I create the app as a split-screen app from the start, the detail nib is fixed and cannot be changed.

    Thanks.
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Did you look at the Class Reference for UISplitViewController (in particular, the properties)?
     
  3. pinsrw thread starter macrumors regular

    Joined:
    May 30, 2010
    #3
    Well my question is more basic. When I create an application with a split view controller, it creates XIBs for the root view and detail view...

    1.
    These XIBs are loaded at start-up.... but I don't know where that happens. That detail appears to be hidden.

    2.
    I created some more XIBs for my other detail views but I don't know where precisely I need to put the code to load those. There is no clear place to tell the application to automatically load the additional XIBs.

    3.
    Also I created copies of the DetailViewController class for each of the other XIBs, since each view will have its own logic separate from the others. However in the root view controller class there is a datum called detailedView, but it of the type DetailViewController, not any of my other XIBs' types. And yet some of the boilerplate code seems to expect that one type of object.

    4.
    To solve the problem in #3, I decided to create a generic DetailedViewController class and subclassed all of the particular detailed view classes from it. However it is not linked to any XIB, and the one DetailedView XIB as it is generic and will not have an XIB associated with it.

    It seems to me that the problems I am having stem from the fact that important details are hidden from view. I need to know how things work under the hood so that I can change things.
     
  4. dejo, Nov 4, 2010
    Last edited: Nov 4, 2010

    dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    UISplitViewController only has two properties. One of them holds the key to doing what you're wanting to do. The Class Reference even links to Related Sample Code that could really help you out. That is why I asked if you looked at it.
     
  5. pinsrw, Nov 4, 2010
    Last edited: Nov 4, 2010

    pinsrw thread starter macrumors regular

    Joined:
    May 30, 2010
    #5
    OK, I got it to work.
    What I found is that adapting the original XIB that I got from selecting split-view app was impossible. I had to instead adapt the MainWindow.xib from the sample project.
    Thanks.
     

Share This Page