Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashing on memory warnings #11

Closed
SolomonBier opened this issue Jan 21, 2015 · 3 comments
Closed

App crashing on memory warnings #11

SolomonBier opened this issue Jan 21, 2015 · 3 comments

Comments

@SolomonBier
Copy link
Contributor

I'm downloading pictures from Amazon S3 and setting the main image view via the setMainImage method. This works fine, but when scrolling the app crashes with a memory warning.

Is there a size constraint I should abide by ?

@SolomonBier
Copy link
Contributor Author

Fixed the above with the following code. May be worth adding to the setMainImage method:

        // Resize Image
        CGSize size=CGSizeMake(self.mainImageView.frame.size.width,self.mainImageView.frame.size.height);
        UIGraphicsBeginImageContext(size);
        [tempImage drawInRect:CGRectMake(0, 0, size.width, size.height)];
        UIImage *scaledImage = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
        //End Resize Image

        [self setMainImage:scaledImage];

@matteogobbi
Copy link
Owner

Hi,
If you think to have fixed an issue, please submit a pull request.

Thank you.

@SolomonBier
Copy link
Contributor Author

Submitted pull request. This edit may also address the other memory warning you previously closed.

Great work, love this VC!

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants