Re: JSONSerialization 'Garbage at end' error

2014-04-30 Thread Kyle Sluder
On Wed, Apr 30, 2014, at 04:30 PM, Jens Alfke wrote: > > On Apr 30, 2014, at 4:00 PM, Jonathan Hull wrote: > > > I also find that it is good practice to set variables returned by reference > > to nil before passing them. > > NSError *error = nil; > > Otherwise, they will contain garbage, and ca

Re: JSONSerialization 'Garbage at end' error

2014-04-30 Thread Jens Alfke
On Apr 30, 2014, at 4:00 PM, Jonathan Hull wrote: > I also find that it is good practice to set variables returned by reference > to nil before passing them. > NSError *error = nil; > Otherwise, they will contain garbage, and cannot reliably be tested to see if > the value was set. That’s sti

Re: JSONSerialization 'Garbage at end' error

2014-04-30 Thread Quincey Morris
On Apr 30, 2014, at 16:00 , Jonathan Hull wrote: > I also find that it is good practice to set variables returned by reference > to nil before passing them. > > NSError *error = nil; > > Otherwise, they will contain garbage, and cannot reliably be tested to see if > the value was set. This p

Re: JSONSerialization 'Garbage at end' error

2014-04-30 Thread Jonathan Hull
I also find that it is good practice to set variables returned by reference to nil before passing them. NSError *error = nil; Otherwise, they will contain garbage, and cannot reliably be tested to see if the value was set. Andy is right though, that it is better to test whether jsonObject is

Re: JSONSerialization 'Garbage at end' error

2014-04-30 Thread Diederik Meijer | Ten Horses
Thanks Andy and Jens! Op Apr 30, 2014, om 10:07 PM heeft Andy Lee het volgende geschreven: > On Apr 30, 2014, at 3:21 PM, Jens Alfke wrote: >> On Apr 30, 2014, at 8:20 AM, Diederik Meijer | Ten Horses >> wrote: >> >>> Now here is the problem: although the JSON parses fine and populates a

Re: JSONSerialization 'Garbage at end' error

2014-04-30 Thread Diederik Meijer | Ten Horses
Thanks Steve, that's promising, most likely something wrong in my NSURLConnection code then, or the way I call it. I don't think there's anything trailing in the JSON content, there really isn'tt much in there his is the api server code: format('d.m.Y'); $Hyperlink = $row['hyperlink

Re: JSONSerialization 'Garbage at end' error

2014-04-30 Thread Andy Lee
On Apr 30, 2014, at 3:21 PM, Jens Alfke wrote: > On Apr 30, 2014, at 8:20 AM, Diederik Meijer | Ten Horses > wrote: > >> Now here is the problem: although the JSON parses fine and populates a >> UITableView without any issues, I am still getting the following error: > > If the JSON parsed fin

Re: JSONSerialization 'Garbage at end' error

2014-04-30 Thread Andy Lee
On Apr 30, 2014, at 3:21 PM, Jens Alfke wrote: > You’ll need to do some detective work to find out what function call that > error is really coming from. At that point you can set a breakpoint and look > at the input data. Maybe for debugging purposes you could drop in an open-source JSON parse

Re: JSONSerialization 'Garbage at end' error

2014-04-30 Thread Jens Alfke
On Apr 30, 2014, at 12:14 PM, Steve Christensen wrote: > Doing a brief search, it seems like when others are running into this error, > they’re working with JSON data that really does have garbage at the end. Yeah, I’ve been doing a ton of JSON work with NSJSONSerialization for as long as it’

Re: JSONSerialization 'Garbage at end' error

2014-04-30 Thread Steve Christensen
I’m already doing downloads in my app using NSURLSession so I used my existing code to download and decode the data returned by the URL below and didn’t get an error. I am building against iOS 7.1 and I tried it out in the simulator. Doing a brief search, it seems like when others are running in

Re: JSONSerialization 'Garbage at end' error

2014-04-30 Thread Jens Alfke
On Apr 30, 2014, at 8:20 AM, Diederik Meijer | Ten Horses wrote: > Now here is the problem: although the JSON parses fine and populates a > UITableView without any issues, I am still getting the following error: If the JSON parsed fine, then the error must be coming from somewhere else. A ca

JSONSerialization 'Garbage at end' error

2014-04-30 Thread Diederik Meijer | Ten Horses
Hi all, I have Googled this issue for hours and tried various solutions suggested at Stackoverflow, but can't seem to solve the following problem. I am pulling JSON from here: http://www.tenhorses.com/apps/meijburg/dotTAXDataHandler/dotTAXtaxNotesAPI.php Both JSONLint, http://jsonformatter.cur