0
是否可以在UITapGestureRecognizer
上作出分類?我想製作方便的方法來避免(alloc-init)遊戲。在uitapGestureRecognizer上做類別?
我厭倦了這一點:
+(void)tapDetector :(sel)selectormethod tags:(int)tag :tapsRequired:(int)taps{
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc]initWithTarget:ac action:@selector(??????????????????:)];
singleTap.numberOfTapsRequired = tag;
singleTap.numberOfTouchesRequired = tag;
}
但問題是,我不能讓selectorMethod作爲動作參數......任何人都可以在這方面提供幫助? 。
「prob is tha我不能得到selectorMethod作爲一個動作參數「爲什麼你不能?選擇器是一個可以作爲參數傳遞的對象,就像任何其他對象一樣。有什麼麻煩?你有什麼嘗試? – matt