Split view UIBarButtonItem button is jumping rightward

Discussion in 'iPhone/iPad Programming' started by pinsrw, Jan 31, 2011.

  1. macrumors regular

    Joined:
    May 30, 2010
    #1
    Hi all,

    I'm using the sample split-view app code from Apple that implements multiple different detail views, each stored in its own xib.
    I have discovered a big problem:
    When I switch between views in portrait mode, the UIBarButtonItem that brings up the popover window keeps jumping to the right.
    I looked at how many items are in the toolbar items array, that in the detail view is created to insert the UIBarButtonItem into the toolbar and later remove it. That number keeps growing...
    In fact, invalidateRootPopoverButtonItem:barButtonItem is not getting called.

    My detail views are declared like this:

    @interface DetailView2: UIViewController
    <UIPopoverControllerDelegate,
    UISplitViewControllerDelegate,
    SubstitutableDetailViewController>

    Thanks for any help.
     
  2. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Can we see the code where you are adding and removing the barButtonItem?
     
  3. pinsrw, Feb 1, 2011
    Last edited: Feb 2, 2011

    thread starter macrumors regular

    Joined:
    May 30, 2010
    #3
    I've discovered that the reason for my troubles is that I was trying to cache the detail views, whereas Apple's sample code wanted to reload the xib's every time they were to be displayed.
     
  4. pinsrw, Feb 1, 2011
    Last edited: Feb 2, 2011

    thread starter macrumors regular

    Joined:
    May 30, 2010
    #4
    .
     

Share This Page