开发者

What is the correct way to use NSURLConnection return data?

What is the difference between the following two code snippets? When I use the first snippet, the requests goes through but data holds 0 bytes, where as in the second case I do get the data. I know the second snippet works but why? I am using synchronous call here.

This one returns 0 bytes of data...

NSData *data  = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];

This one returns correct data...

NSData *data ;
data = [NSURLConnectio开发者_Python百科n sendSynchronousRequest:theRequest returningResponse:&response error:&error];


There's no difference between these two statements. Are you absolutely sure that there's no other modification?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜