Inherits from NSObject
Declared in DTFolderMonitor.h

Overview

Class for monitoring changes on a folder. This can be used to monitor the application documents folder for changes in the files there if the user adds or removes files via iTunes file sharing.

Tasks

Creating a Folder Monitor

Starting/Stopping Monitoring

Class Methods

folderMonitorForURL:block:

Creates a new DTFolderMonitor to watch the folder at the given URL. Whenever there is a change on this folder the block is executed.

+ (DTFolderMonitor *)folderMonitorForURL:(NSURL *)URL block:(DTFolderMonitorBlock)block

Parameters

URL

The monitored folder URL

block

The block to execute if the folder is being modified

Return Value

The instantiated monitor in suspended mode. Call startMonitoring to start monitoring.

Discussion

The URL must be a file URL. Both the URL and the block parameter are mandatory. The block is being dispatched on a background queue.

Declared In

DTFolderMonitor.h

Instance Methods

startMonitoring

Start monitoring the folder. A monitor can be started and stopped multiple times.

- (void)startMonitoring

Declared In

DTFolderMonitor.h

stopMonitoring

Stop monitoring the folder. A monitor can be started and stopped multiple times.

- (void)stopMonitoring

Declared In

DTFolderMonitor.h