Reputation: 1873
My application must receive few contents of files from the Internet in separated threads (I use NSThread). But thread method completes before content of file is received (because NSURLConnection works asynchronously). And I can't be sure that my file is downloaded when thread is completed.
Upvotes: 0
Views: 387
Reputation: 49354
send a synchronous request:
id data = [NSURLConnection sendSynchronousRequest:myRequest returningResponse:&myResponse error:nil];
Upvotes: 2