I'm using NSURLConnection to load an image (of size 1.2 mb) from server. What I'm doing is in delegate I'm assigning my imageView (its an UIImageView) with received image. So it looks like downloading.
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
UIImage *image = [UIImage imageWithData:receivedData];
imageView.image = image;
image = nil;
}
During the time XCode prints NSLog with the following message.
<Error>: ImageIO: JPEG Corrupt JPEG data: premature end of data segment
I know its the message of corruted bytes i'm making an UIImage and then assing it to imageView.
Is there anyway to stop XCode to write this message on behalf of me? I've to do so as I need to show user that image is downloading.
I've checked some answers that on checking bytes!! But its not my solution as I already know why this happens?, I just want to stop XCode to print this on be half of me.
Edited
Data would corrupted while Downloading using of NSURLConnection.
Thanks!
connectionDidFinishLoadingan show activity indicator instead.commentanswer! What if there will be 50 of images can be load at the same time, and I don't just relay onUIActivityIndicatorandprogressCounteras I'm already doing so. I want to make it friendly that user get attention thatyes, images are coming!! :).no-userwill get so!! But when I run it in device it still prints it. You know as developer a single message would jump us on our chair!!! :D