NSDictionary rootDict = (NSDictionary) PropertyListParser.parse(plist);
java.lang.ClassCastException: com.dd.plist.NSArray cannot be cast to com.dd.plist.NSDictionary
--
You received this message because you are subscribed to the Google Groups "plist-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plist-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
<?xml version="1.0" encoding="UTF-8"?>
<!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>ID</key>
<string>01</string>
<key>Title</key>
<string>The first title</string>
</dict>
</array>
<array>
<dict>
<key>ID</key>
<string>02</string>
<key>Title</key>
<string>The second title</string>
</dict>
</array>
...
NSArray rootArray = (NSArray)PropertyListParser.parse(plist);
NSObject[] obj = rootArray.getArray();
for(NSObject param:obj) {
NSDictionary title = (NSDictionary) param;
Log.d("Title", title.objectForKey("Title").toString());
}