Instance Method

initWithData:

Initializes a parser with the XML contents encapsulated in a given data object.

Declaration

- (instancetype)initWithData:(NSData *)data;

Parameters

data

An NSData object containing XML markup.

Return Value

An initialized NSXMLParser object or nil if an error occurs.

Discussion

This method is the designated initializer.

See Also

Initializing a Parser Object

- initWithContentsOfURL:

Initializes a parser with the XML content referenced by the given URL.

- initWithStream:

Initializes a parser with the XML contents from the specified stream and parses it..