Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't show popover controller with UIBarButtonItem
    primarykey
    data
    text
    <p>i use storyboard for developing UI for my project. There are many issues were solved, but this problem killing me. I have added action for UIBarButtonItem :</p> <pre><code>- (IBAction)pressAddActionButton:(UIBarButtonItem *)sender { if (_mode == itemSelect) { LookUpTableViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"lookupTable"]; vc.key = @"title"; vc.data = [Linesheet MR_findAllSortedBy:@"title" ascending:YES]; vc.lookUpDelegate = self; self.myPopoverController = [[UIPopoverController alloc] initWithContentViewController:vc]; [self.myPopoverController presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES]; } else { self.mode = itemSelect; } </code></pre> <p>}</p> <p>If i using storyBoard segue for showing popover - all good, but if i do it <strong>in runtime a popover does not show</strong>. I should manually create UIBarButtonItem.</p> <p>Thanks for help!!!</p> <p><strong>Update, code for buttons:</strong></p> <pre><code>- (void)setupNavigationItems { self.navigationController.navigationBarHidden = NO; UIBarButtonItem *addItem; if (_mode == itemSelect) { addItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(pressAddActionButton:)]; } else { addItem = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:self action:@selector(pressDoneButton:)]; } [addItem setStyle:UIBarButtonItemStyleBordered]; UIBarButtonItem *separator = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil]; UIBarButtonItem *action = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(pressActionButton:)]; [action setStyle:UIBarButtonItemStyleBordered]; [toolbar setItems:[NSArray arrayWithObjects:separator, addItem, action, nil] animated:YES]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload