开发者

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];     
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜