8

I've added a UISwipeGestureRecognizer to my Xcode nib and having it there makes my app crash with:

..exception 'NSInvalidArgumentException', reason: '-[UISwipeGestureRecognizer initWithCoder:]: unrecognized selector sent to instance 0x5c2ab30'.

Why?

logancautrell
  • 8,762
  • 3
  • 37
  • 50
Nektarios
  • 9,551
  • 7
  • 57
  • 91

1 Answers1

21

This is happening because you're running the app on the wrong version of iOS. You can't put gesture recognizers in a xib file on iOS <5, so you'll have to create them in code if you want to support older versions of iOS.

jtbandes
  • 104,858
  • 34
  • 217
  • 242