Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IBAction in Xcode 4.5

Anybody experiencing no response for IBAction touchUpInside in Xcode 4.5, deployment target iOS 5 as well? It works in simulator for me having iOS6, but not iOS5.

like image 702
Michal Avatar asked Oct 05 '12 11:10

Michal


2 Answers

I had this same issue because I was using a tap gesture. You should be able to keep your existing code by adding the line below. This will keep your tap gesture from killing any taps on interior buttons and such...

yourTapGesture.cancelsTouchesInView = NO;
like image 96
Scruffy Paws Avatar answered Nov 02 '22 15:11

Scruffy Paws


Edit:

I have found the solution. I was adding a tap gesture to the view, which was overriding the view's ability to detect a touchUpInside action on any buttons since they are part of the view as well. So what you should do is either remove the gesture recognizer or make it specific to a certain object. For example, I added the touch gesture to the specified part of the view that was not on the subview (I created a new object / outlet and labeled it as such). Still not sure why it's different in 5.1 vs. 6.0, but this should help you.

Original Post:

I am having the same issue. I have a project where buttons on a subview are clickable on version 6.0 of the simulator but not version 5.1. I have some gesture recognizers in there as well but commented them out to see if they were the issue and they are not. The only thing I have found is that the buttons are sometimes clickable on a touch up outside action (even though they are programmed for touch up inside), so I am not sure if maybe Apple changed the eNums for button actions? If I come up with a solution I will be sure to provide it here.

like image 35
Brian Sachetta Avatar answered Nov 02 '22 17:11

Brian Sachetta