SetRightBarButtonItems iOS5 not working

I am using the new UINavigationItem API setRightBarButtonItems like this:

UIBarButtonItem *buttonSettings = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"settings.png"] 
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


source to share

1 answer

You are not allowed to do this:

UIBarButtonSystemItemPageCurl Button to hang the system page. The image of this button can only be used for toolbar items located on toolbars. Available in iOS 4.0 and later. Declared in UIBarButtonItem.h.



All Articles