PDA

View Full Version : Split view UIBarButtonItem button is jumping rightward




pinsrw
Jan 31, 2011, 09:26 PM
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.



dejo
Feb 1, 2011, 11:01 AM
Can we see the code where you are adding and removing the barButtonItem?

pinsrw
Feb 1, 2011, 06:26 PM
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.

pinsrw
Feb 1, 2011, 07:15 PM
.