2011-02-25 44 views
2

我想這個代碼......問題的姿態

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) 

在哪裏我錯了嗎?

回答

4

您試圖運行此項目的設備爲UIGestureRecognizer,可從iOS 3.2及更高版本獲取。

+0

我正在使用iOS 3.1 –

+1

難怪你的應用程序崩潰了......我已經提到UIGestureRecognizer的最低要求是iOS 3.2 –