title: iOS Simulator inconsistent with iPad 2, UIBarButtonItem
body: <p>So something interesting happened yesterday that I don't know if it's ever happened to someone else.  I basically add a UIBarButtonItem to the tool bar based on which tab is selected in the tabbarcontroller.  For example, in tab 2, I add it like this:</p>
  
  <pre><code>NSMutableArray *barItems = [[self.MainToolbar items] mutableCopy];
              if (_sortButton == nil) {
                  _sortButton = [[UIBarButtonItem alloc] initWithTitle:@"Sort" style:UIBarButtonItemStyleBordered target:self action:@selector(sortButtonPressed:)];
              }
              [barItems insertObject:_sortButton atIndex:0];
              [self.MainToolbar setItems:barItems];
              [barItems release];
  </code></pre>
  
  <p>Similarly, when I remove the button, I do this:</p>
  
  <pre><code>if (_sortButton != nil) {
              self.SortButton = nil;
              NSMutableArray *barItems = [[self.MainToolbar items] mutableCopy];
              [barItems removeObjectAtIndex:0];
              [self.MainToolbar setItems:barItems];
              [barItems release];
          }
  </code></pre>
  
  <p>So on the simulator, it works fine.  I can switch between tabs, navigate through the app, and I have not seen problems with the button.  I have also tested this functionality with instruments and did not see any obvious problems.  Then when I put it on the actual iPad 2, when I would click on the tab the first time, it showed up fine, then I clicked on a different tab, then clicked back to the tab 2, and the button would move to the right a little bit (it's positioned all the way on the left of the tool bar at the start).  Then you click away, and come back, and again, it moves more to the right.  Not sure why it's happening yet, but I was also unsure why it only happened on the device, and not in the simulator for something like this.  I definitely know that things should always be tested on the actual hardware, but just wondering if this is a known problem to others.  Thanks!</p>