Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

make UIImage conform to the NSCopying protocol

The question is quite simple, I need to have an UIImage conform to NSCopying protocol but I have absolutely no idea on where to start to achieve this.

Do you have any pointer to help me?

Thanks in advance

like image 844
AP. Avatar asked Dec 30 '22 05:12

AP.


1 Answers

- (id) copyWithZone: (NSZone *) zone
{
    return [[UIImage allocWithZone: zone] initWithCGImage: self.CGImage];
}
like image 59
Costique Avatar answered Jan 05 '23 00:01

Costique