I have a navigation controller based app, and added some toolbar items with code in viewDidLoad:
NSArray* toolbarItems = [NSArray arrayWithObjects:
                         [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd 
                                                                       target:self
                                                                       action:@selector(addButton)],
                         [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace 
                        开发者_StackOverflow中文版                                               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 an actionSheet with [UIActionSheet showFromToolbar:] and I want a UIToolbar * for that, how can I get the UIToolbar that I have created earlier?
I assume you mean "of the current view controller." In that case you want self.navigationController.toolbar.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论