I'm working on an app that can remove large amounts of files. When I invoke the NSFileManager's removeItemAtPath method, the app's UI locks until the operation finishes (this can take a while).
I tried fixing this by invoking the method using performSelectorInBackground but it didn't work.
Any ideas?
Thanks in advance.
You could try using GCD to do it in a background thread.
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) {
[[NSFileManager defaultManager] removeItemAtPath:path];
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With