0

When the App tries to sign up a user, it doesn't work and returns the error:

Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}".

I've done research and couldn't find anything relevant to Parse.

Parse SDK: 1.12.0

Code:

user.signUpInBackgroundWithBlock { (succeeded: Bool, error: NSError?) -> Void in
        if let error = error {
            print(error.description)
        } else {

            self.performSegueWithIdentifier("signup_signin", sender: nil)
        }
    }

JSON of what gets returned when using the REST API

TechSd
  • 11
  • 7

1 Answers1

0

Maybe this will help


Unless you pass the option NSJSONReadingAllowFragments to [NSJSONSerialization JSONObjectWithData:options:error:] the response from the server must be valid JSON with a top level container which is an array or dictionary.

Tim Penner
  • 3,551
  • 21
  • 36
  • This information helped, but I was unable to modify the framework. I've included a picture of the JSON using the API if that helps. – TechSd Feb 28 '16 at 00:35
  • sorry i dont have much info from the screenshot; but if my answer was helpful you can upvote it (tooltip says 'this answer is useful') without marking it as the answer. Unless you feel that it is the answer, then by all means please mark it as so. – Tim Penner Feb 28 '16 at 00:45