问题
Possible Duplicate:
Parsing XML in Cocoa
iPhone - Can we parse .plist(xml) file using NSXMLParser?
回答1:
You can absolutely use the NSXMLParser to parse an xml plist file. However, it is much, much
, much, easier to simply use the NSPropertyListSerialization
class to do that.
回答2:
There are simpler ways of reading a plist file. You can use the following method for NSDictionary
and NSArray
:
- (id)initWithContentsOfFile:(NSString *)aPath
来源:https://stackoverflow.com/questions/2207404/iphone-can-we-parse-plistxml-file-using-nsxmlparser