Its really easy. Lets First look how to create a UIToolbar then addd items to it and then change them during run time
self.MNToolbar=[[UIToolbar alloc] init];
self.addButton=[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(importPhotos:)];
self.flexibleSpace=[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
self.MNToolbar.items=[[NSArray alloc] initWithObjects:flexibleSpace, addButton, flexibleSpace, nil];
[self.view addSubView:self.MNToolbar];
// don't forget to set the bounds too
This is how to create it.
Ok now lets see how to alter it during runtime
self.deleteButton=[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(deletePhotos:)];
self.MNToolbar.items=[[NSArray alloc] initWithObjects:self.deleteButton, nil];
I hope you get the point. If you have any questions let me know.