QBPopupMenu icon indicating copy to clipboard operation
QBPopupMenu copied to clipboard

no sender sent to button action

Open wtholliday opened this issue 6 years ago • 0 comments

If the QBPopupMenuItem was the sender, a single action could handle multiple menu items. This is good when the menu items are generated programatically.

For example:

- (void)contextMenuItemSelected:(id)sender {
  QBPopupMenuItem *item = (QBPopupMenuItem*) sender;
  assert(item); // This currently fails.
  [self performCommandNamed: item.title];
}

This change is as simple as modifying -[QBPopupMenuItemView performAction]:

[self.item.target performSelector:self.item.action withObject:self.item afterDelay:0];

wtholliday avatar Aug 29 '17 04:08 wtholliday