NSDictionary(DTError) Category Reference
Declared in | NSDictionary+DTError.h |
Overview
A collection of useful additions for NSDictionary
to deal with Property Lists and also to get error handling for malformed data.
Class Methods
dictionaryWithContentsOfData:error:
Creates and returns a dictionary using the keys and values found in the given data.
+ (NSDictionary *)dictionaryWithContentsOfData:(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 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
NSDictionary+DTError.h
dictionaryWithContentsOfFile:error:
Creates and returns a dictionary using the keys and values found in a file specified by a given path.
+ (NSDictionary *)dictionaryWithContentsOfFile:(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
NSDictionary+DTError.h
dictionaryWithContentsOfURL:error:
Creates and returns a dictionary using the keys and values found in a file specified by a given URL.
+ (NSDictionary *)dictionaryWithContentsOfURL:(NSURL *)URL error:(NSError **)error
Parameters
- URL
An URL. The file identified by URL 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
NSDictionary+DTError.h