Error with JSON in App

So when I try retreive the JSON from my site I get an error with the Json problem, here it is



Error Domain=NSCocoaErrorDomain Code=3840 "Garbage at end."


on this line of code



let json = try NSJSONSerialization.JSONObjectWithData(data!, options: .MutableContainers) as! NSDictionary


it happens with both NSArray and NSDictionary

The meaning of this error is pretty clear: the JSON you passed in is malformed, containing bytes after the end of the top-level object. You should look at the data you’ve passed to NSJSONSerialization to see what’s wrong with it.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi, I had this bug too but finally managed to fix it. Anyway, see for yourself on the website https://maximumhorrors.com/

Error with JSON in App
 
 
Q