Skip to content

Instantly share code, notes, and snippets.

@Shaolo
Created August 5, 2011 22:43
Show Gist options
  • Save Shaolo/1128707 to your computer and use it in GitHub Desktop.
Save Shaolo/1128707 to your computer and use it in GitHub Desktop.
- (void)showRootPopoverButtonItem:(UIBarButtonItem *)barButtonItem
{
// Add the popover button to the toolbar.
NSMutableArray *itemsArray = [self.toolbar.items mutableCopy];
// NSAssert(barButtonItem, @"Bar button item nil");
if(barButtonItem)
[itemsArray insertObject:barButtonItem atIndex:0];
else
NSLog(@"Tried adding nil barButtonItem");
[self.toolbar setItems:itemsArray animated:NO];
[itemsArray release];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment