Getting data out of the NSURLResponse completion block

前端 未结 3 662
情深已故
情深已故 2020-12-24 09:54

It looks like I didn\'t get the concept of blocks completely yet...

In my code I have to get out the JSON data from the asychronous block to be retur

3条回答
  •  时光说笑
    2020-12-24 10:12

    Check the string when converting data coming from server using below code:

     NSLog(@"dataAsString %@", [NSString stringWithUTF8String:[data bytes]]);
    

    if the string is in a proper JSON format, ONLY then your JSON object will be correct.

    Hope this hepls!!

提交回复
热议问题