Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

no sender sent to button action #29

Open
wtholliday opened this issue Aug 29, 2017 · 0 comments
Open

no sender sent to button action #29

wtholliday opened this issue Aug 29, 2017 · 0 comments

Comments

@wtholliday
Copy link

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];

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant