Problem adding UIBarButtonItems to a ToolBar

Posted by Olivier de Jonge on Stack Overflow See other posts from Stack Overflow or by Olivier de Jonge
Published on 2010-03-19T06:05:49Z Indexed on 2010/03/19 6:11 UTC
Read the original article Hit count: 246

Filed under:
|
|
|
|

I have a UINavigationController with a UITableViewController in it. I want to show a ToolBar on the bottom with UIBarButtonItem's. The ToolBar is showing up, but the buttons won't appear. Anyone knows why?

  - (void)viewDidLoad {
        [super viewDidLoad];
     [[self navigationItem] setTitle:@"Selections List"];
     [[self navigationItem] setRightBarButtonItem:[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addProjectSearch:)] autorelease]];
        [[self navigationItem] setLeftBarButtonItem:[self editButtonItem]];
     [[super tableView] setDataSource: self];
     [[super tableView] setDelegate: self];

     //Toolbar 
     UIBarButtonItem * logoutButton = [[[UIBarButtonItem alloc] initWithTitle:@"Log out" style:UIBarButtonItemStylePlain target:self action:@selector(logOut:)]autorelease];
     NSMutableArray * arr = [NSMutableArray arrayWithObjects:logoutButton, nil];
     [[self navigationController] setToolbarHidden: NO animated:YES];
     [[self navigationController] setToolbarItems:arr animated:YES]; 
    }

© Stack Overflow or respective owner

Related posts about iphone

Related posts about cocoa