我使用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