objective c - Can't parse JSON from data in connectionDidFinishLoading – Maybe it's too much data? -
i'm sending out request external api , parsing response sbjson parser. however, suspect response long, somehow getting jumbled.
in mainviewcontroller.h file set nsmutabledata *receiveddata; can use in connection methods in mainviewcontroller.m file.
however, after connection finishes loading, execute following:
- (void)connectiondidfinishloading:(nsurlconnection *)connection { nsstring *datastring = [[nsstring alloc] initwithdata:receiveddata encoding:nsutf8stringencoding]; nsarray *alldata = [datastring jsonvalue]; } however, bunch of errors saying json not formatted. so, when @ json, long – here , there, there problems... example, "updated_at" below.
{ "id": 7844333, "position": 3, "content": "cell height off 5 pixels", "created_at": "2012-06-04t20:31:30-05:00", "updated_at": "2ator": { "id": 98258, "name": "brian" } what think happened above updated @ has value of "2012-06...etc" , next key-value item creator : { id, name } somehow got jumbled updated at.
anyone having similar problem? don't think problem jsonvalue because nslog out datastring before gets parsed, , thats find json errors.
what mean nsstring *datastring = [[nsstring alloc] initwithdata:receiveddata encoding:nsutf8stringencoding]; long string, has bad json in because jumbled.
are using receiveddata more 1 connection @ once?
:)
Comments
Post a Comment