0

I'm calling NSURLConnection -sendSynchronousRequest in NSOperation, but the method returns immediately. I would expect it to block the operation until all data is received. Is this a misunderstanding on my part?

Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
Morrowless
  • 6,856
  • 11
  • 51
  • 81

1 Answers1

0

set the delegate of the NSURLConnection object to self

NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
and then implement the connectionDidFinishLoading methode
-(void)connectionDidFinishLoading:(NSURLConnection *)connection{
//your code
}

touti
  • 1,164
  • 6
  • 18