Good afternoon,
I am passing a JSON string to an iOS app and an Android app from a webservice. Business rules dictate that this JSON string CAN contain data with a quotation mark.
{"message": [{"MessageID": "22", "CompanyID": "0897001", "MessageText": "this "message" has quotes", "JobID": "BT201-Main-1-031508-134700", "AttachmentCount": "0", "MainDevice": "1"},{"MessageID": "23", "CompanyID": "0897001", "MessageText": "this message has no quotes", "JobID": "BT201-Main-1-031508-134700", "AttachmentCount": "0", "MainDevice": "1"}]}
After doing a little google-ing, I have found that if I want to send data with quotation marks enclosed, I just need to preface the quotation marks inside of the value with a backslash:
{"MessageID": "22", "CompanyID": "0897001", "MessageText": "this \"message\" has quotes", "JobID": "BT201-Main-1-031508-134700", "AttachmentCount": "0", "MainDevice": "1"}
When the android app gets this JSON, it parses it beautifully. The data displays in the view with quotes and all. Not so with the iOS app. What can I do to the JSON to get the iOS app to properly parse the JSON? I am currently using SBJSON in my iOS app. Any help would be greatly appreciated. Thanks!