Declared in NSString+DTPaths.h

Overview

A collection of useful additions for NSString to deal with paths.

Class Methods

cachesPath

Determines the path to the Library/Caches folder in the current application’s sandbox.

+ (NSString *)cachesPath

Return Value

The path to the app’s Caches folder.

Discussion

The return value is cached on the first call.

Declared In

NSString+DTPaths.h

documentsPath

Determines the path to the Documents folder in the current application’s sandbox.

+ (NSString *)documentsPath

Return Value

The path to the app’s Documents folder.

Discussion

The return value is cached on the first call.

Declared In

NSString+DTPaths.h

pathForTemporaryFile

Creates a unique filename that can be used for one temporary file or folder.

+ (NSString *)pathForTemporaryFile

Return Value

The generated temporary path.

Discussion

The returned string is different on every call. It is created by combining the result from temporaryPath with a unique UUID.

Declared In

NSString+DTPaths.h

temporaryPath

Determines the path for temporary files in the current application’s sandbox.

+ (NSString *)temporaryPath

Return Value

The path to the app’s folder for temporary files.

Discussion

The return value is cached on the first call. This value is different in Simulator than on the actual device. In Simulator you get a reference to /tmp wheras on iOS devices it is a special folder inside the application folder.

Declared In

NSString+DTPaths.h

Instance Methods

pathByDeletingSequenceNumber

Removes a sequence number in brackets

- (NSString *)pathByDeletingSequenceNumber

Return Value

The modified path

Discussion

If the receiver number suffix then it is removed. If not the receiver is returned.

Declared In

NSString+DTPaths.h

pathByIncrementingSequenceNumber

Appends or Increments a sequence number in brackets

- (NSString *)pathByIncrementingSequenceNumber

Return Value

The incremented path

Discussion

If the receiver already has a number suffix then it is incremented. If not then (1) is added.

Declared In

NSString+DTPaths.h