allen58992008 / touchcode

Automatically exported from code.google.com/p/touchcode
0 stars 0 forks source link

touchJSON: (1, 1) serializes into [11] #68

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  try to serialize an array with two elements, each an [NSNumber  
numberWithInt:1]
2. get bad results.

What is the expected output? What do you see instead?

Expected:  [1, 1]
GOT: [11]

What version of the product are you using? On what operating system?
latest (1.0.6), on MacOSX building for the iPhone

Please provide any additional information below.

I asked people on #iphonedev on freenode to confirm, and they did.  Here was 
their anonymized 
responses:

This. if (theValue != [inArray lastObject]) [theString appendString:@","];

That's friggin stupid.

It doesn't take into account the fact that arrays might have the same object in 
them twice

Better way: keep track of the index, and compare the index to the array length 

Original issue reported on code.google.com by kismetww...@kismetworldwide.com on 9 Dec 2009 at 2:12

GoogleCodeExporter commented 8 years ago
This was fixed a while ago. I suggest you make sure you're running the latest 
code from version control before 
accusing anything of being "frigging stupid".

Original comment by jwight on 15 Dec 2009 at 9:58

GoogleCodeExporter commented 8 years ago
Oh and see http://code.google.com/p/touchcode/issues/detail?id=52 for more 
information.

Original comment by jwight on 15 Dec 2009 at 9:59

GoogleCodeExporter commented 8 years ago
I was using 1.0.6, which was the latest in "downloads" when I submitted the 
bug, and
the people on IRC downloaded it and tested it from the same place, I believe 
1.0.6
(but did not see them actually test it), so I'm not sure this was fixed in 
1.0.6.  I
noticed there's now a 1.0.7 that got submitted 40 minutes ago, if I've got time 
I'll
check the code, but since the bug I switched to json-framework and that seems 
to be
working better.

If people should be running the latest code from SVN, not the "downloads" 
.zip's,
maybe you could make that clearer on the "downloads" page, as I assumed SVN was
in-dev and not fully tested, and the builds in "downloads" were the tested 
releases.

And I wasn't accusing anyone of anything, I just quick copied and pasted the IRC
responses because it had the location of the code.  I should've removed the 
"friggin
stupid" line, my apologies for the unintended insult.

Thanks for the reply.

Original comment by kismetww...@kismetworldwide.com on 15 Dec 2009 at 11:01

GoogleCodeExporter commented 8 years ago
I just tested with the 1.0.7 .zip uploaded 81 minutes ago and this seems to be 
fixed
in 1.0.7.  Thanks.

Original comment by kismetww...@kismetworldwide.com on 15 Dec 2009 at 11:42