【问题标题】:Problem with gesture手势问题
【发布时间】:2011-02-25 06:02:37
【问题描述】:

我试过这段代码......

self.swipeRecognizer = [UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:);
swipeRecognizer.direction = UISwipeGestureRecognizerDirectionLeft;
self.view addGestureRecognizer:swipeRecognizer;

它在模拟器中运行良好,但在使用设备时出现以下错误:

2011-02-25 11:16:25.250 OnlyGizmos489:207 *** -UISwipeGestureRecognizer setDirection:: unrecognized selector sent to instance 0x1b6950
2011-02-25 11:16:25.257 OnlyGizmos489:207 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -UISwipeGestureRecognizer setDirection:: unrecognized selector sent to instance 0x1b6950'
2011-02-25 11:16:25.269 OnlyGizmos489:207 Stack: (
843263261,
825818644,
843267069,
842763033,
842725440,
26283,
844154820,
844283872,
844283288,
844282948,
844281236,
844280752,
844182692,
844181896,
21373,
844473760,
844851728,
862896011,
843011267,
843009055,
860901832,
843738160,
843731504,
11617,
11532
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
(gdb)

我哪里错了?

【问题讨论】:

    标签: iphone objective-c uiwebview gesture


    【解决方案1】:

    您尝试在哪个设备上运行此项目,因为 UIGestureRecognizer 适用于 iOS 3.2 及更高版本。

    【讨论】:

    • 难怪你的应用程序崩溃了...我已经提到 UIGestureRecognizer 的最低要求是 iOS 3.2
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-06-13
    • 1970-01-01
    • 2011-06-19
    • 1970-01-01
    • 2012-01-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多