I have a case with an odd edge right now in that response code from the delegate method of NSURLConnection:
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response;
Run before the next delegation method:
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data;
My code, of course, can use the enhancement, as right now it checks the HTTP response code from the above, and then calls some method to take action. Unfortunately, data is not yet available at this point.
What are some elegant solutions for connecting response and responseData in such a way that my class method does not start until response and responseData become 200 + nil . Do I need to set both of them as class instance variables? Sounds like a poor man's decision.
source share