Hi I want to create multiple thread in my game. One thread is for timer and other for touch event. Because when i am running this game on iphone timer conflict the touch events so touch event will not be detected. Its working smooth on iphone simulator but on iphone or on itouch its became very slow. So i m using thread for touch and timer. When i give [NSThread sleepForTimeInterval:0.01] call to timer it sleep all threads means touch also get stop. I want to stop perticular thread only.
This is my code in touchesBegan -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BOOL Done = NO;
while (!Done)
{
NSAutoreleasePool *loopPool = [[NSAutoreleasePool alloc] init];
[NSThread sleepForTimeInterval:0.01];
[self performSelectorOnMainThread:@selector(callTapCode) withObject:tapView waitUntilDone:YES];
//performSelectorOnMainThread:@selector(callTapCode) withObject:nil waitUntilDone:YES];
[loopPool release];
Done=YES;
}
[pool drain];
}
please its very urgent help me out :(