Skip to content

Instantly share code, notes, and snippets.

@ejknapp
Created November 24, 2009 00:52
Show Gist options
  • Save ejknapp/241526 to your computer and use it in GitHub Desktop.
Save ejknapp/241526 to your computer and use it in GitHub Desktop.
#pragma mark NSURLConnection Delagate Callback Methods
- (void)connection:(NSURLConnection *)connection
didReceiveResponse:(NSURLResponse *)response {
NSLog(@"In didReceiveResponse");
self.responseString = @"";
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
NSLog(@"In didReceiveData");
NSString *newText = [[NSString alloc]
initWithData:data encoding:NSUTF8StringEncoding];
if (newText != NULL) {
self.responseString = [self.responseString stringByAppendingString:newText];
}
[newText release];
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
NSLog(@"In connectionDidFinishLoading");
[self.flakManager processNewMessagesData:self.responseString];
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
NSLog(@"NSURLConnection Failure: %@", error);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment