Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIKit UISwipeGestureRecognizer in Xcode crashes app during nib loading?

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?

like image 535
Nektarios Avatar asked Jul 17 '11 20:07

Nektarios


1 Answers

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.

like image 71
jtbandes Avatar answered Nov 01 '22 21:11

jtbandes