調用UIPanGestureRecognizer的touchesBegan在UIPanGestureRecognizer的自定義子類,當我重寫的touchesBegan:警告從子類
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[[self view].superview bringSubviewToFront:[self view]];
[super touchesBegan:touches withEvent:event];
}
超行得到警告:
....warning: 'UIPanGestureRecognizer' may not respond to '-touchesBegan:withEvent:'
... Semantic Issue: 'UIPanGestureRecognizer' may not respond to 'touchesBegan:withEvent:'
這是爲什麼?
解決此問題的最初嘗試是通過根據UIGestureRecognizer的子類UIGestureRecognizer文檔導入'UIGestureRecognizerSubclass.h',但是當我嘗試這樣做時,我得到'沒有這樣的文件或目錄'錯誤。
我有UIKit.framework包括在內,並嘗試添加
#import <UIKit/UIKit.h>
,但它也不起作用。
我忘記了什麼嗎?
包含該文件不會阻止您顯示的指示的警告我想,您能告訴我們實際上警告是什麼嗎? – 2011-07-11 13:47:23