Maybe somebody can give a hint how to solve the below problem. I
have files which are plist/XML types where some values need to be
retrieved. The values often show up as "dict, string". How do I
bring those together?
Below an example
{|Dictionary|:"typedstreamÅËÑ@ÑÑÑ
NSDictionaryÑÑNSObjectÖÑiíÑÑÑNSStringîÑ
+NSParagraphStyleÜíÑÑÑNSParagraphStyleîÑCC@SÖÜíÑñóNSExpansionÜíÑÑ
ÑNSNumberÑÑNSValueîÑ*ÑÑfùÉΩÑ,∆ÜíÑñóNSColorÜíÑÑÑNSColorîÑcÑff
ÜíÑñóNSFontÜíÑÑÑNSFontîïÑ[28c]˛ˇHelveticaù
$üüüüÜíÑñóNSBackgroundColorÜíцü†ÜÜ", |
String|:"typedstreamÅËÑ@ÑÑÑNSAttributedStringÑÑNSObjectÖíÑÑÑNSS
tringîÑ+1245ÜÑiIíÑÑÑ
NSDictionaryîÑiíÑññNSParagraphStyleÜíÑÑÑNSParagraphStyleîÑCC@SÖÜ
íÑññNSExpansionÜíÑÑÑNSNumberÑÑNSValueîÑ*ÑÑfüÉΩÑ,∆ÜíÑññNSFontÜíÑÑ
ÑNSFontîôÑ[28c]˛ˇHelveticaü$Ñc¢¢¢ÜíÑññNSColorÜíÑÑÑNSColorî
¢ÑffÜÜÜ"}
I looked at the NSDictonary class, but didn't find a working solution.
I believe this is an archive format but am not familiar with the
NSArchiver. Should be an easy 'call method' though.
If it really is a .plist, then there is a utility 'plutil' which will
convert binary plists to text ones. Also Carbon has some nice plist
functions in CFPreferences.h (also I think in CFURLAccess.h) which
will load a plist directly into a CFDictionaryRef regardless of the
file's format. CFDictionaryRef is toll free bridged to NSDictionary.