SetRightBarButtonItems iOS5 not working
I am using the new UINavigationItem API setRightBarButtonItems like this:
UIBarButtonItem *buttonSettings = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"settings.png"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(showSettings:)];
UIBarButtonItem *buttonLogout = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPageCurl target:self action:@selector(showSettings:)];
[[self navigationItem] setRightBarButtonItems:[NSArray arrayWithObjects:buttonLogout, buttonSettings, nil]];
But only 1 button (settings) appears and the logout button does not appear at all. What am I doing wrong? Thanks to
+3
source to share