I create a new thread that launches one of my methods at every specific time interval.
Now what I am doing is as follows:
NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(setUpTimerThread) object:nil]; [thread start];
the above method calls my setUpTimerThraed method, and this method does NSTimer and calls a specific ie syncData method every 1 minute. Now what I want is my synchronization. The data method sends some files to the FTP folder. and when ever he sends one file to FTP, I want his "stream" to sleep for a while.
I used
[NSThread sleepForTimeInterval:3.0]
But this code blocks my main application thread. Is there a way that I can only sleep the thread thread for a while, so that it will not stop my application for 3 seconds and will not sleep in my main thread. I hope that I have what I ask the guys about. Help PLease?
source share