我是iPhone开发的新手,我有一个以下的澄清
- ( void )touchesEnded: ( NSSet * )touches withEvent: ( UIEvent * )event
//-----------------------------------------------------------------------
{
if( !mouseSwiped )
{
UITouch *touch = [[event allTouches] anyObject];
// Enumerates through all touch object
for (touch in touches)
{
// Sends to the dispatch method, which will make sure the appropriate subview is acted upon
[self dispatchTouchAtPoint:[touch locationInView:self.view] :touches :nil];
}
}
}
当我为我的应用程序运行静态分析器时,我得到以下
Value stored to 'touch' during its initialization is never read
我不是什么意思......
请指导我......
答案 0 :(得分:2)
要进行for each
循环,您必须在括号内声明'touch',如下所示:
for (UITouch *touch in [touches allObjects]) {
// Sends to the dispatch method, which will make sure the appropriate subview is acted upon
[self dispatchTouchAtPoint:[touch locationInView:self.view] :touches :nil];
}