Just in the appdelegates, applicationDidBecomeActive. I create and start a thread, this thread waits an asynchronous download and then save data:
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// begins Asynchronous download data (1 second):
[wsDataComponents updatePreparedData:NO];
NSThread* downloadThread = [[NSThread alloc]
initWithTarget:self
selector: @selector (waitingFirstConnection)
object:nil];
[downloadThread start];
}
then
-(void)waitingFirstConnection{
while (waitingFirstDownload) {
// Do nothing ... Waiting a asynchronous download, Observers tell me when
// finish first donwload
}
// begins Synchronous download, and save data (20 secons)
[wsDataComponents updatePreparedData:YES];
// Maybe is this the problem ?? I change a label in main view controller
[menuViewController.labelBadgeVideo setText:@"123 videos"];
// Nothig else, finish and this thread is destroyed
}
In the Organizer console, when finished, I am getting this warning:
CoreAnimation: warning, deleted thread with uncommitted CATransaction;