Another way to do that and avoiding warnings is as follows:
[[UIApplication sharedApplication] sendAction:barButtonItem.action
to:barButtonItem.target
from:nil
forEvent:nil];