我无法访问 XML 的节点:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>cnt_id</key>
<string>lovenyc</string>
<key>user</key>
<string></string>
<key>emps_cnpj</key>
<string>11379404000154</string>
<key>depto_id</key>
<string>0</string>
<key>id_device</key>
<string>7543AF5F-495D-4739-BB83-56BF08CE7DF0</string>
<key>data_acesso</key>
<string>2013-01-04 12:48:21</string>
<key>id_usuario</key>
<string></string>
<key>user_fav</key>
<string>0</string>
<key>user_like</key>
<string>0</string>
<key>user_lat</key>
<string></string>
</dict>
</array>
</plist>
目标c代码:
-(void) parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)
namespaceURI qualifiedName:(NSString *) qName attributes:(NSDictionary *)attributeDict
{
NSMutableDictionary * dict = [[NSMutableDictionary alloc]init];
_xmlObjects = [[NSMutableArray alloc]init];
NSLog(@"Attribute %@",[attributeDict allKeys]);
NSLog(@"Attribute Values %@",[attributeDict allValues]);
}
日志总是给我空值,例如,我无法访问该<string>
值,有什么建议吗?谢谢