iPhone - Can we parse .plist(xml) file using NSXML

2019-08-12 03:57发布

问题:

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