我使用here中的一些代碼來確定何時確定多點觸摸序列中最後一根手指何時擡起。Objective C警告:從不同的Objective-C類型中傳遞'touchesForView:'的參數1
下面的代碼:
/*
Determining when the last finger in a multi-touch sequence has lifted
When you want to know when the last finger in a multi-touch sequence is lifted
from a view, compare the number of UITouch objects in the passed in set with the
number of touches for the view maintained by the passed-in UIEvent object.
For example:
*/
- (void) touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event {
if ([touches count] == [[event touchesForView:self] count]) {
// last finger has lifted....
}
}
我得到警告:
passing argument 1 of 'touchesForView:' from distinct Objective-C type
的代碼生成並運行很好,但我想刪除它但不明白警告的含義。有任何想法嗎?
非常感謝你的時間,鏈接和迴應!我其實並沒有創建一個新的iPhone應用程序,而是在cocos2d(一個遊戲引擎)的土地上,但我認爲下一個遇到類似問題並閱讀此答案的人將會節省很多時間:-)再次感謝! – Stu 2009-07-03 14:57:55