I do not see an error in your code, but the error indicates that the instance of gestureRecognizer is not being transmitted by UITapGestureRecognizer. Place a breakpoint on the fault line and get the gestureRecognizer type identifier.
In addition: make sure that you are using SDK 4.0 or higher from iPhone. Gesture recognition devices appeared in version 3.2 for the iPad and 4.0 for the iPhone.) I suspect that you are fine, although I think you would get the error earlier if you had not used the correct SDK.
source
share