How can I get the current type UIToolbar

I have an application based on the navigation controller and added some toolbar elements with code in viewDidLoad:

 NSArray* toolbarItems = [NSArray arrayWithObjects: [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addButton)], [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil], [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:self action:@selector(composeMail)], nil]; [toolbarItems makeObjectsPerformSelector:@selector(release)]; self.toolbarItems = toolbarItems; 

now I want to show the actionSheet with [UIActionSheet showFromToolbar:] and I want UIToolbar * , how can I get the UIToolbar that I created earlier?

+4
source share
1 answer

I assume you mean "current view controller". In this case, you want self.navigationController.toolbar .

+4
source

All Articles