title: iOS-Cannot convert value of type 'String' to expected argument type 'Data'
body: <p>I have a JSON data as a string and i want to decode this data to a list of object but im getting this error: "Cannot convert value of type 'String' to expected argument type 'Data'"</p>
  
  <p>this is my code:</p>
  
  <pre><code>struct DatabaseObject: Decodable{
      var CityNameL = ""
      var DBName = ""
      var DBNameID = 0
      var IDName = ""
  }
  
  func jsonToObject(json:String){
  
  
      do{
       let databases = try  JSONDecoder().decode(DatabaseObject.self,from: json)
      }catch let jsonErr {
       print(jsonErr)
      }
   }
  </code></pre>
  
  <p>this is the json data: </p>
  
  <pre><code>[{"CityNameL":"Skeleton East","DBName":"SkeletonEAST","DBNameID":29,"IDName":"SKELETONEASTLOCAL"},{"CityNameL":"SKELETON DEMO/SKELETON DEMO","DBName":"SKELETONDEMO","DBNameID":30,"IDName":"SKELETONEASTDOT2"},{"CityNameL":"SKELETONPARAMS","DBName":"FFMSCENTRAL","DBNameID":31,"IDName":"FFMSCENTRALLOCAL"},{"CityNameL":"SKELECBM","DBName":"SKELETONFFMS","DBNameID":32,"IDName":"LOCAL"}]
  </code></pre>
  
  <p>so is there a way to convert String to Data or is there other way for decoding it.</p>