At the server end (GAE), I’ve got a java Hashtable.
At the client end (iPhone), I’m trying to create an NSDictionary.
myHashTable.toString() gets me something that looks darned-close-to-but-not-quite-the-same-as [myDictionary description]. If they were the same, I could write the string to a file and do:
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:tmpFile];
I could write a little parser in obj-C to deal with myHashtable.toString(), but I’m sort-of hoping that there’s a shortcut already built into something, somewhere — I just can’t seem to find it.
(So, being a geek, I’ll spend far longer searching the web for a shortcut than it would take me to write & debug the parser… 😉
Anyway — hints?
Thanks!
I would convert the
Hashtableinto somethingJSON-like and take it on the iPhone side.Hashtable.toString()is not ideal, it will have problem with spaces, comma and quotation marks.For JSON-to-NSDictionary, you can find the
json-frameworktools under http://www.json.org/