How can I add 2 buttons into the UINavigationBar
without XIB?
The 2 buttons should be aligned on the right side of the UINavigationBar
.
I know how I can add one button, but how about two?
With iOS 5+ it's as easy as:
UIBarButtonItem *btnShare = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(share)];
UIBarButtonItem *btnRefresh = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refresh)];
[self.navigationItem setRightBarButtonItems:[NSArray arrayWithObjects:btnShare, btnRefresh, nil]];