/ Published in: Objective C

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
- (IBAction)download:(id)sender { NSURLRequest *theRequest = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:10.0]; connection = nil; } } if (data==nil) { } [data appendData:recievedData]; float progress = [resourceLength floatValue] / [self.filesize floatValue]; progressLine.progress = progress; } [connection release]; connection=nil; UIImageView* imageView = [[[UIImageView alloc] initWithImage:[UIImage imageWithData:data]] autorelease]; imageView.frame = self.view.bounds; imageView.contentMode = UIViewContentModeScaleAspectFit; imageView.autoresizingMask = ( UIViewAutoresizingFlexibleWidth || UIViewAutoresizingFlexibleHeight ); [self.view addSubview:imageView]; [data release]; data=nil; }
Comments
