Inherits from NSObject
Declared in PXLoader.h
PXLoader.m

Overview

A PXLoader is a base loader class that lays out the foundation for each different type of loader.

Tasks

Properties

data

The loaded data.

@property (nonatomic, readonly) NSData *data

Declared In

PXLoader.h

origin

The origin of the loaded data.

@property (nonatomic, readonly) NSString *origin

Declared In

PXLoader.h

originType

The origin type either PXLoaderOriginType_File or PXLoaderOriginType_URL

@property (nonatomic, readonly) PXLoaderOriginType originType

Declared In

PXLoader.h

Class Methods

absolutePathFromPath:

Creates the absolute path from the relative path given. If the path is already absolute, then it is just returned back.

+ (NSString *)absolutePathFromPath:(NSString *)path

Parameters

path

The relative path.

Return Value

The absolute path.

Declared In

PXLoader.m

findFileAtPath:withBaseName:validExtensions:

Tries to find a file at the given path with the given base name and one of the provided extensions.

+ (NSString *)findFileAtPath:(NSString *)basePath withBaseName:(NSString *)baseName validExtensions:(NSArray *)extensions

Parameters

basePath

The directory in which the file is to be found

baseName

The name of the file to be found not including its extension

extensions

Valid extensions to match against the files in basePath

Return Value

The path to the found file or nil if one couldn’t be found.

Declared In

PXLoader.m

pathForSiblingOfFile:withExtension:

Looks for a sibling of the current file, with the same name but a different extension.

+ (NSString *)pathForSiblingOfFile:(NSString *)path withExtension:(NSString *)extension

Declared In

PXLoader.m

pathForSiblingOfFile:withName:

Looks for a sibling of the current file, with the given name.

+ (NSString *)pathForSiblingOfFile:(NSString *)path withName:(NSString *)fileName

Declared In

PXLoader.m

Instance Methods

initWithContentsOfFile:

Creates a new loader object containing the loaded information as data. Returns nil if the file could not be found, or the file type isn’t supported.

- (id)initWithContentsOfFile:(NSString *)path

Parameters

filePath

The path of the file to load. The file path may be absolute or relative to the application bundle.

Declared In

PXLoader.m

initWithContentsOfURL:

Creates a new loader object containing the loaded information as data. Returns nil if the file could not be found, or the file type isn’t supported.

- (id)initWithContentsOfURL:(NSURL *)url

Parameters

url

The url of the file to load.

Declared In

PXLoader.m