objective c - Parsing JSON from PHP by SBJson -


now i'm trying post jpeg files mysql via php , mysql ios.

in method encode jpeg(as nsdata) , related data(ex. caption, timestamp) json on php script using json_encode().

    {"caption":"(captiondata)","img":"(imagedata)","timestamp":"(timestampdata)"} 

then set datas array like,

    [{"caption":"(captiondata)","img":"(imagedata)","timestamp":"(timestampdata)"},      {"caption":"(captiondata)","img":"(imagedata)","timestamp":"(timestampdata)"},      .......,      {"caption":"(captiondata)","img":"(imagedata)","timestamp":"(timestampdata)"}] 

i believe can parse , json echo (json_encode ()) on php , sbjsonparser on ios nothing returns app. here's code in ios.(also use tturlrequest three20)

    tturlrequest* request = [tturlrequest requestwithurl:url delegate:self];     request.cachepolicy = cachepolicy;     tturljsonresponse* response = [[[tturljsonresponse alloc] init] autorelease];     request.response = response;     [request send];      - (void)requestdidfinishload:(tturlrequest*)request {         tturljsonresponse* response = request.response;         nslog(@"%@",response);     } 

can print logs in requestdidfinishload:?

the response rootobject of tturljsonresponse.

- (void)requestdidfinishload:(tturlrequest*)request {      tturljsonresponse *response = request.response;     nsdictionary *dict = response.rootobject;     nslog(@"dict : %@",dict);  } 

in case,

- (void)requestdidfinishload:(tturlrequest*)request {     tturljsonresponse* response = request.response;     nslog(@"%@",response); } 

the response may <tturljsonresponse: 0x125398c0>

if still nothing returns, may check requestdidfinishload: been called , not cache issue.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -