UIImage *image1 = [UIImage imageNamed:@"someImage"];
UIImage *image2 = [UIImage imageWithCGImage:image1.CGImage];
Deep Copy UIImage with ARC
-
01-10-2022 - |
Pergunta
I have one UIImage which I want to deep copy to another (so that I may add it to an NSMUtableArray of images)
I cannot get it to deep copy, I have looked at zones and such but this no luck.
This is what I have trieD:
_incrementalImage = UIGraphicsGetImageFromCurrentImageContext();
UIImage *imgcpy = [[UIImage allocWithZone:[_incrementalImage zone]];
[stack addObject:imgcpy];
Basically I need a copy of incrementalImage onto stack that won't change if _incrementalImage or currentImageContext changes.
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow