Why would UIBarButtonItems simply not show up?
Why would UIBarButtonItems simply not show up?
- Subject: Why would UIBarButtonItems simply not show up?
- From: Gavin Stokes <email@hidden>
- Date: Tue, 10 Jul 2012 02:02:28 -0700
I have a screen that can be flipped over to show a map, and from the map
the user can invoke a detail controller for an item on the map. So I
instantiate a navigation controller, make the map controller its root-view
controller, and then invoke it:
- (void)showMap
{
StashMapController* mapController = [[StashMapController alloc]
initWithNibName:@"StashMap" stashes:_ownedStashes];
mapController.delegate = self;
UINavigationController* mapNavController = [[UINavigationController alloc]
initWithRootViewController:mapController];
[mapController release];
mapNavController.modalTransitionStyle =
UIModalTransitionStyleFlipHorizontal;
// Do flip transition.
[self presentModalViewController:mapNavController animated:YES];
}
In the map controller's viewDidLoad, I add two bar-button items as the
right buttons:
UIBarButtonItem* globeButton = [[UIBarButtonItem alloc]
initWithImage:[UIImage imageNamed:@"globe_white"]
style:UIBarButtonItemStyleBordered target:self action:@selector(zoomOut:)];
UIBarButtonItem* homeButton = [[UIBarButtonItem alloc]
initWithImage:[UIImage imageNamed:@"location-arrow_white"]
style:UIBarButtonItemStyleBordered target:self action:@selector(home:)];
self.navigationItem.rightBarButtonItems = [[NSArray alloc]
initWithObjects:globeButton, homeButton, nil];
They're allocated, but they just don't show up. Adding one of them as a
single button doesn't work either.
Setting *self.navigationItem.title* DOES work, so I know I'm dealing with
the right structure.
Any insight appreciated!
Gavin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden