XML解析器代理功能澄清

时间:2012-08-28 07:21:15

标签: iphone objective-c nsxmlparser

我想知道每个参数对于以下委托方法的值是什么。

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict

2 个答案:

答案 0 :(得分:0)

浏览苹果文档。它简要地说明了所有这些。请参阅link

答案 1 :(得分:0)

didStartElement:的namespaceURI:的qualifiedName:属性:

当遇到给定元素的开始标记时,由解析器对象发送给它的委托。

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict

参数

解析器

A parser object.

的ElementName

A string that is the name of an element (in its start tag).

的namespaceURI

If namespace processing is turned on, contains the URI for the current namespace as a string object.

的qualifiedName

If namespace processing is turned on, contains the qualified name for the current namespace as a string object..

attributeDict

A dictionary that contains any attributes associated with the element. Keys are the names of attributes, and values are attribute values.

了解更多信息请点击以下链接: http://developer.apple.com/library/ios/#documentation/cocoa/reference/NSXMLParserDelegate_Protocol/Reference/Reference.html