I am setting the UIGestureRecognizer for iPhone App. I am doing it in InterfaceBuilder by dragging Long Press Gesture Recognizer from Objects library to the view which must accept gestures.
After I add a Gesture Recognizer in this way, it has Referencing Outlet Collection pointing to the view which should accept the gesture.
Then in ViewController I add an IBOutlet pointing to the GestureRecognizer
IBOutlet UILongPressGestureRecognizer *gestRec;
and corresponding action for the Gesture Recognizer
-(IBAction)longPress:(id)sender;
So after it Gesture Recognizer shows in Interface builder the outlet and the action named longPress: with target named ControlManager
But my program crashes when I make long press gesture in iPhoneSimulator. When I NSlog the description of my GestureRecognizer it shows the following output:
<UILongPressGestureRecognizer: 0x6859620;
state = Possible;
view = <UIView 0x6859e20>;
target= <(action=longPress:, target=<ControlManager 0x6859af0>)>>
I think that problem is in last line and that it should look like this:
target=<ControlManager 0x6859af0>;
action=longPress:
Am I doing something wrong?