I have a UIButton that is loaded from a xib file as an IBOutlet property of a view controller. I attach a selector to the button in the viewDidLoad of my view controller:
[_myButton addTarget:self action:@selector(mySelector) forControlEvents:UIControlEventTouchUpInside];
In iOS 6 everything works, but when i run on the simulator in iOS 5.0 the selector doesn't get called. The button does highlight when it is touched.
Another thing to note is that the button is in a UIView that has a UITapGestureRecognizer added to it. The UITapGestureRecognizer for this view gets called in iOS 5.0 when the button is tapped, (it does not get called in iOS 6, where the button's selector is called instead).
I don't have a device running iOS 5 so I haven't tested on a device, just the simulator.
Does anyone know what is happening here, and how to solve it?