0

In application currently upload and download of data is done using json webservice. For example: For uploading I am sending json string to webservice and webservice uploading that data to my sql server database.

all these things are done when i fire some event.

1.For conversion of json string i used SBJson. 2.and for HTTP request i used NSURLConnection.

My requirement:

Currently, all communication between device and server is done by main thread. my requirement is not to bring load on main thread. instead it happen using background thread. this background thread should responsible for send request and receive there response.

Problem:

I need to send data by using background thread or using GCD so that when background uploading is in progress application UI not going to block. but when i am implementing it in my application it is not working as expected.My thread is exiting and not wait for response and blocking the UI too. let me guide which things i need to take care of.

1 Answers1

0

Give this previous post a shot (maybe someone with higher rep can resolve as dup as well):

iOS: how to perform a HTTP POST request?

For a quick win (even though its not supported officially), you can give this library a shot: http://allseeing-i.com/ASIHTTPRequest/

Community
  • 1
  • 1
Adam B
  • 3,775
  • 3
  • 32
  • 42
  • Above answer won't work for me. it only show how to send HTTP Request. currently it's possible for me to make request response. I need to do it on background thread. – Ganesh Lunawat Aug 09 '12 at 09:39