Is it possible to call an asynchronus NSURLRequest from a thread(NSThread)?
If yes, then is this a good practice?
If no, then can any one can explain with code snippet that what can be the issue?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is possible, but usually not necessary. To do this, you would need to set up an
NSRunLoopon your secondary thread.Usually it’s better to just use
NSURLConnectionfrom the main thread, it will still not block. For processing the downloaded data, you could easily usedispatch_asyncfrom theconnectionDidFinishLoading:delegate method.