UIKit UISwipeGestureRecognizer in Xcode crashes app during nib loading?
Asked Answered
D

1

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?

Destruction answered 17/7, 2011 at 20:12 Comment(2)
Are you running it on the wrong version of iOS?Expansion
@jtbandes: ugh yes. I'm using 5.0 sdk and was using 4.3.x simulator. That's unfortunate.. why would this issue exist? How should I address it?Destruction
E
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.

Expansion answered 17/7, 2011 at 23:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.