Inherits from NSObject
Declared in DTAsyncFileDeleter.h

Overview

This class deletes large amounts of files asynchronously. You should use the sharedInstance to get an instance. On iOS this automatically starts a background task if the app is suspended so that file deletion can complete.

Tasks

Creating A File Deleter

Asynchronous Operations

Class Methods

sharedInstance

Creates a shared file deleter.

+ (DTAsyncFileDeleter *)sharedInstance

Declared In

DTAsyncFileDeleter.h

Instance Methods

removeItemAtPath:

Removes the file or directory at the specified path and immediately returns.

- (void)removeItemAtPath:(NSString *)path

Parameters

path

A path string indicating the file or directory to remove. If the path specifies a directory, the contents of that directory are recursively removed.

Discussion

This method moves the given item to a temporary name which is an instant operation. It then schedules an asynchronous background operation to actually remove the item.

Declared In

DTAsyncFileDeleter.h

removeItemAtURL:

Removes the file or directory at the specified URL.

- (void)removeItemAtURL:(NSURL *)URL

Parameters

URL

A file URL specifying the file or directory to remove. If the URL specifies a directory, the contents of that directory are recursively removed.

Discussion

This method moves the given item to a temporary name which is an instant operation. It then schedules an asynchronous background operation to actually remove the item.

Declared In

DTAsyncFileDeleter.h

waitUntilFinished

Blocks execution of the current thread until the receiver finishes.

- (void)waitUntilFinished

Declared In

DTAsyncFileDeleter.h