iOS Code Snippet JSON to Map Convesion

Discussion in 'iOS Code Snippets' started by Mashiane, May 27, 2015.

  1. Mashiane

    Mashiane Well-Known Member Licensed User

    This converts a json string to a map, your json strings should be enclosed with double quotes. Example:

    {"path":"encounter between rebekah and isaac.jpg","text":"Encounter Between Rebekah And Isaac"}

    This will work even if you have enclosed this in square brackets or not..

    Sub JsonToMap(strJSON As StringAs Map

    ' convert a json string to a map
        Dim jMap As Map
    Dim JSON As JSONParser
        jMap = JSON.NextObject
    Return jMap
    End Sub
    ShaneG30 and victormedranop like this.