I’m getting an error when trying to serialize jsonData to an object:
let jsonObject = try JSONSerialization.jsonObject(with: jsonData, options: [])
The error message:
Error creating JSON object: 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.}
Correct me if I’m wrong somehow, but the book, on page 581 has:
“nojsoncallback”: “1”,
with a “c”.
/****************************/
With nojsoncallback": “1”,
I get: Error fetching interesting photos: invalidJSONData
With nojsoncallbak": “1”,
Get: Error fetching interesting photos: 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.}
That says to me the nojsoncallback": “1”, is the way to go and I have some other error that I gotta work on?