Beruflich Dokumente
Kultur Dokumente
iPhone Application
});
}
// 4) Modify call method inside other method to be the following
dispatch_async(backgroundQueue, ^(void) {
// Method which process zip files and give you original data
});
// 5) Modify call to delegate at the end of download zip AND process zip to be
the following
dispatch_async(dispatch_get_main_queue(), ^(void) {
// Call method to change UI as per background task
});
These all are simple but important steps,
1) While creating dispatch queue, ensure that each dispatch queue has its
unique name. So when you are creating it provide unique name to it. The
best way to do this is to use reverse DNS notation.
2) Dont forget to release dispatch queue in dealloc method.
3) Run download file process in the backgroundQueue in the background
thread, with a simple call to dispatch_async!
4) Similarly, after downloading file, call another method to unzip downloaded
file in background thread. Reusing same dispatch queue does it.
5) Finally switch Main thread to show update user interface.