0

I have a class with a method called:

-(NSData*)getSomeDataWithError:(NSError **)error;

I am using a synchronous NSURLConnection, my question is how do I wait for the connection to get the data when calling getSomeDataWithError?

2
  • If you are using a synchronous request, then it will block until the data is received. I don't understand what your problem is. Jun 11, 2012 at 11:35
  • I start the connection in the init method of my class. This is a separate instance method that I call to get the data. I don't want to use delegation as a pattern.
    – John Lane
    Jun 11, 2012 at 13:06

1 Answer 1

0

If you have a synchronous request, your app will wait for the request to finish before it carries on executing any more code.

Also, I would have to ask why you are passing an NSError into your function? It makes no sense.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.