Hi everyone,
I'm pretty new to iphone sdk, so please excuse me if my question doesn't make sense !
I have an issue with json parsing :
- I established a connection to a remote server to receive a json object, which looks like this :
Code:
{"news1":{"title":"hello", "content":"hello world"}, "news2":{"title":"hi", "content":"hi world"}, .... }
- In the didReceiveData method, I assigned the json string :
Code:
NSString *jsonString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- then I built my dictionary :
Code:
NSDictionary *results = [jsonString JSONValue];
As long as the "content" string doesn't exceed a certain number of characters, everything works fine.
But if my "content" string becomes very long (which should be the case at the end of my project), the news do not load and the console returns the following error :
Quote:
2009-11-16 16:25:16.778 newsReaderV5[3448:207] -JSONValue failed. Error trace is: (
Error Domain=org.brautaset.JSON.ErrorDomain Code=5 UserInfo=0x3b29380 "Unescaped control character '0x0'",
Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x3b29770 "Object value expected for key: content",
Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x3b29850 "Object value expected for key: news1"
)
2009-11-16 16:25:16.789 newsReaderV5[3448:207] -JSONValue failed. Error trace is: (
Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x3b2a3c0 "Unrecognised leading character"
)
|
Does anyone have an idea about what all this means ? I'm completely stuck here...
Thanks in advance for your help !