Hi, I have a problem with my code. I lunch the thread and this thread have a NSTimer. I must remember a variabile location but when i repeat the method i reinitialize these and i lose the progress. Can you help me? Thanks
My code:(these isn't my very code but is the same situation. I want remeber the number of the i but when restart the methods the program reinitialize the i)
-(void)callDectectionMove:(Movement*)tempMovement{
int i = 0;
i++;
if(i == 5)
return;
[NSTimer scheduledTimerWithTimeInterval:timeToCatch target:self selector:@selector(detectMovement) userInfo:nil repeats:NO];
}
-(int)detectPositionMovement:(float)cordX:(float)cordY:(float)cordZ:(float)sensibility{
[NSThread detachNewThreadSelector:@selector(callDectectionMove) toTarget:self withObject:tempMovement];
}