Declared in NSBundle+RKAdditions.h

Overview

Provides convenience methods for accessing data in resources within an NSBundle.

Tasks

Instance Methods

MIMETypeForResource:withExtension:

Returns the MIME Type for the resource identified by the specified name and file extension.

- (NSString *)MIMETypeForResource:(NSString *)name withExtension:(NSString *)extension

Parameters

name

The name of the resource file.

extension

If extension is an empty string or nil, the extension is assumed not to exist and the file is the first file encountered that exactly matches name.

Return Value

The MIME Type for the resource file or nil if the file could not be located.

Declared In

NSBundle+RKAdditions.h

dataWithContentsOfResource:withExtension:

Creates and returns a data object by reading every byte from the resource identified by the specified name and file extension.

- (NSData *)dataWithContentsOfResource:(NSString *)name withExtension:(NSString *)extension

Parameters

name

The name of the resource file.

extension

If extension is an empty string or nil, the extension is assumed not to exist and the file is the first file encountered that exactly matches name.

Return Value

A data object by reading every byte from the resource file.

Declared In

NSBundle+RKAdditions.h

parsedObjectWithContentsOfResource:withExtension:

Creates and returns an object representation of the data from the resource identified by the specified name and file extension by reading the data as a string and parsing it using a parser appropriate for the MIME Type of the file.

- (id)parsedObjectWithContentsOfResource:(NSString *)name withExtension:(NSString *)extension

Parameters

name

The name of the resource file.

extension

If extension is an empty string or nil, the extension is assumed not to exist and the file is the first file encountered that exactly matches name.

Return Value

A new image object for the specified file, or nil if the method could not initialize the image from the specified file.

Declared In

NSBundle+RKAdditions.h

stringWithContentsOfResource:withExtension:encoding:

Creates and returns a string object by reading data from the resource identified by the specified name and file extension using a given encoding.

- (NSString *)stringWithContentsOfResource:(NSString *)name withExtension:(NSString *)extension encoding:(NSStringEncoding)encoding

Parameters

name

The name of the resource file.

extension

If extension is an empty string or nil, the extension is assumed not to exist and the file is the first file encountered that exactly matches name.

encoding

The encoding of the resource file.

Return Value

A string created by reading data from the resource file using the encoding.

Declared In

NSBundle+RKAdditions.h