title: Error Domain=NSCocoaErrorDomain Code=3840 Parse Swift 4.2
body: <p>I have issues with parse data base.</p>
  <p>When i want to send data to data base, i got such type of error:</p>
  <blockquote>
  <p>Error Domain=NSCocoaErrorDomain Code=3840 &quot;JSON text did not start with array or object and option to allow fragments not set.&quot; UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}</p>
  </blockquote>
  <p>Console:</p>
  <p><a href="https://i.stack.imgur.com/Z83UA.jpg" rel="nofollow noreferrer">Image</a></p>
  <p>I have no idea whats is wrong, i have lot of data which i need send to data base, but i cant.</p>
  <p>My code:</p>
  <pre><code>func sendDataToServer() {
      do {
          
          let path = Bundle.main.path(forResource: &quot;data&quot;, ofType: &quot;txt&quot;)
          let source = try? String.init(contentsOfFile: path!)
          var elements = source?.components(separatedBy: &quot;\n\n&quot;) // Here is the change
          var parsedObject = [[String: String]]()
          
          for i in 0..&lt;(elements?.count)! - 1 {
              let objects = [String : String]()
              let element = elements![i]
              
              let objectsElement = element.components(separatedBy: &quot;\n&quot;) // And Here
          
              if objectsElement.count &gt; 1 {
  
                  let question = objectsElement[0]
                  let answer1 = objectsElement[1]
                  let answer2 = objectsElement[2]
                  let answer3 = objectsElement[3]
                  let answer4 = objectsElement[4]
                  let answer5 = objectsElement[5]
                 
                  let array = [&quot;\(answer1)&quot;,&quot;\(answer2)&quot;,&quot;\(answer3)&quot;,&quot;\(answer4)&quot;,&quot;\(answer5)&quot;]
                let result = array.shuffled()
                  
                  let ans1 = result[0]
                  let ans2 = result[1]
                  let ans3 = result[2]
                  let ans4 = result[3]
                  let ans5 = result[4]
                  print(ans1,ans2,ans3,ans4,ans5)
                  
                  let addDatasToDB = PFObject(className: &quot;testBase&quot;)// creating name table
                  addDatasToDB[&quot;question&quot;] =  question // send data from loaded txt file
                  addDatasToDB[&quot;answer1&quot;] = ans1
                  addDatasToDB[&quot;answer2&quot;] = ans2
                  addDatasToDB[&quot;answer3&quot;] = ans3
                  addDatasToDB[&quot;answer4&quot;] = ans4
                  addDatasToDB[&quot;answer5&quot;] = ans5
                  parsedObject.append(objects)
                  addDatasToDB.saveEventually { (success, error) in
                      self.count += 1
                     
                      if success {
            print(&quot;-------&gt;successfuly saved \(self.count)&quot;)
                      }
                      else {
                          print(error!)
                      }
                  }
              }
          }
  }
  }
  </code></pre>