I have an odd edge case right now in that a response code from an NSURLConnection delegate method:
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response;
Is triggered before the subsequent delegate method:
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data;
My code could certainly use improvement as right now it checks for the HTTP Response Code from the above, then calls on some method to take action. Unfortunately at that point, the data is not yet available.
What are some elegant solutions for coupling the response
and the responseData
in a fashion that my classes method is not triggered until the response
and the responseData
are 200 + not nil
. Do I need to set both of them as class instance variables? Seems like a poor man's solution.