The resulting effect I want, is this. As the device receives data from the server, the image loads progressively
Currently I'm doing something like this
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
[overallData appendData:data];
self.imageView.image = [UIImage imageWithData:overallData];
}
Which is working, but it consumes all the ram, triggers MemoryWarning
and the app crashes sometimes. Not to mention that it shows this error <Error>: ImageIO: JPEG Corrupt JPEG data: premature end of data segment
on each time it runs the code above, but I think that's not a big problem.
Does someone have a better idea of optimization? Otherwise I will have to remove this effect.