Skip to content

Instantly share code, notes, and snippets.

@mtmcfarl
Created September 1, 2012 03:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtmcfarl/3563427 to your computer and use it in GitHub Desktop.
Save mtmcfarl/3563427 to your computer and use it in GitHub Desktop.
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
// Once this method is invoked, "responseData" contains the complete result
NSLog(@"Succeeded! Received %d bytes of data", [receivedData length]);
NSString *dataStr=[[NSString alloc] initWithData:receivedData encoding:NSASCIIStringEncoding];
NSLog(@"Succeeded! Received %@ bytes of data", dataStr);
if ([delegate respondsToSelector:@selector(didFinishDownload:)]) {
NSLog(@"Calling the delegate");
//NSString* dataAsString = [[[NSString alloc] initWithData:receivedData encoding:NSUTF8StringEncoding] autorelease];
[delegate performSelector:@selector(didFinishDownload:) withObject: dataStr];
}
[dataStr release];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment