Value stored to 'touch' during its initialization is never read
I am new to iPhone devlopment and i have a follwing clarification
- ( 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:se开发者_Go百科lf.view] :touches :nil];
}
}
}
and when i run the static analyser for my application, i get the following
Value stored to 'touch' during its initialization is never read
i am not what does it mean...
Please guide me out...
To do a for each
loop, you must declare 'touch' within the parenthesis like this:
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];
}
精彩评论