The code below does what I want - BUT - for some reason now, the buttons do not work. The code for the buttons is identical to what I used before (and what used to work) the only difference is that it is now stored in the 'tools' toolbar/array.
Any ideas on why my buttons are now deactivated?
// creating the two center buttons in the navigation bar
// create a toolbar to have two buttons in the right
UIToolbar* tools = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 0, 44.01)];
// create the array to hold the buttons, which then gets added to the toolbar
NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:5];
// create a non-bordered button (ends up looking like a title)
UIBarButtonItem *bi = [[UIBarButtonItem alloc] initWithTitle:@"Photos" style:UIBarButtonItemStylePlain target:self action:NULL];
initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:NULL];
[buttons addObject:bi];
[bi release];
// create a spacer
bi = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
[buttons addObject:bi];
[bi release];
// create another button with a camera icon
bi = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:self action:@selector(showPhotoPicker)];
bi.style = UIBarButtonItemStyleBordered;
[buttons addObject:bi];
[bi release];
// create a spacer
bi = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
[buttons addObject:bi];
[bi release];
// create another button with 'your photos'
bi = [[UIBarButtonItem alloc] initWithTitle:@"your photos" style:UIBarButtonItemStyleBordered target:self action:@selector(showUserGallery)];
bi.style = UIBarButtonItemStyleBordered;
[buttons addObject:bi];
[bi release];