Question

Possible Duplicate:
iOS5 Stable App Crashing in iOS4.3 Simulator

I have a UIViewController with a xib with a View and a UISwipeGestureRecognizer. When I run in an iOS 6 simulator everything works as intended.

When I run in an iOS 4.3 simulator and attempt to access the viewController.view which causes the xib to be loaded for the first time, then I get this error message:

-[UISwipeGestureRecognizer initWithCoder:]: unrecognized selector sent to instance 0x7385340

Switch back to iOS6, loads no problem. iOS 4.3, crash.

This is my IBOutlet definition for the gesture recognizer I'm creating in that xib:

@property (strong, nonatomic) IBOutlet UISwipeGestureRecognizer *gestureRecognizerSwipeClosed;

enter image description here

Was it helpful?

Solution

This was already answered: here.
I don't know the exact version when UIGestureRecognizers were added to Interface Builder. But it seems that it is not supported in iOS 4.3.
Any object loaded from a nib is initialized with initWithCoder:. So in iOS 4.3 there is no such method to initialize the gesture. What you can do though is create the gestures programmatically, this will work in iOS 4.3.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top