Type Method

dictionaryWithContentsOfURL:error:

Creates a dictionary using the keys and values found in a resource specified by a given URL.

Declaration

+ (NSDictionary<NSString *,ObjectType> *)dictionaryWithContentsOfURL:(NSURL *)url error:(NSError * _Nullable *)error;

Parameters

url

A URL that identifies a resource containing a string representation of a property list whose root object is a dictionary.

Return Value

A new dictionary that contains the dictionary at url, or nil if there is an error or if the contents of the resource are an invalid representation of a dictionary.

Discussion

The dictionary representation in the file identified by path must contain only property list objects (NSString, NSData, NSDate, NSNumber, NSArray, or NSDictionary objects). For more details, see Property List Programming Guide. The objects contained by this dictionary are immutable, even if the dictionary is mutable.

See Also

Creating a Dictionary from an External Source

+ dictionaryWithContentsOfURL:

Creates a dictionary using the keys and values found in a resource specified by a given URL.

Deprecated
- initWithContentsOfURL:error:

Initializes a newly allocated dictionary using the keys and values found at a given URL.

- initWithContentsOfURL:

Initializes a newly allocated dictionary using the keys and values found at a given URL.

Deprecated
+ dictionaryWithContentsOfFile:

Creates a dictionary using the keys and values found in a file specified by a given path.

Deprecated
- initWithContentsOfFile:

Initializes a newly allocated dictionary using the keys and values found in a file at a given path.

Deprecated