• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Why would UIBarButtonItems simply not show up?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Why would UIBarButtonItems simply not show up?
      • From: Gavin Stokes <email@hidden>
  • Prev by Date: Re: One more try - NSCollectionView multi-selection problem..
  • Next by Date: Re: Why would UIBarButtonItems simply not show up?
  • Previous by thread: Field Editor told to replace range {0, NSUIntegerMax} : Range Exception
  • Next by thread: Re: Why would UIBarButtonItems simply not show up?
  • Index(es):
    • Date
    • Thread