NSArray(DTError) Category Reference
Declared in | NSArray+DTError.h |
Overview
A collection of useful additions for NSArray
to deal with Property Lists and also to get error handling for malformed data.
Class Methods
arrayWithContentsOfData:error:
Creates and returns an array encoded in the given blob of data.
+ (NSArray *)arrayWithContentsOfData:(NSData *)data error:(NSError **)error
Parameters
- data
The data object identified by data must contain a string representation of a property list whose root object is an array.
- error
If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, pass in
NULL
.
Return Value
A new array that contains the decoded array, or nil
if there is an error or if the contents of the file are an invalid representation of an array.
Declared In
NSArray+DTError.h
arrayWithContentsOfFile:error:
Creates and returns an array found in a file specified by a given path.
+ (NSArray *)arrayWithContentsOfFile:(NSString *)path error:(NSError **)error
Parameters
- path
A full or relative pathname. The file identified by path must contain a string representation of a property list whose root object is a dictionary.
- error
If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, pass in
NULL
.
Return Value
A new dictionary that contains the dictionary at path, or nil
if there is a file error or if the contents of the file are an invalid representation of a dictionary.
Declared In
NSArray+DTError.h
arrayWithContentsOfURL:error:
Creates and returns an array found in a file specified by a given URL.
+ (NSArray *)arrayWithContentsOfURL:(NSURL *)URL error:(NSError **)error
Parameters
- URL
An
NSURL
. The file identified by URL must contain a string representation of a property list whose root object is an array.
- error
If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, pass in
NULL
.
Return Value
A new array that contains the array at path, or nil
if there is a file error or if the contents of the file are an invalid representation of a array.
Declared In
NSArray+DTError.h