使UIImage符合NSCopying协议 [英] make UIImage conform to the NSCopying protocol
本文介绍了使UIImage符合NSCopying协议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问题很简单,我需要让UIImage符合NSCopying协议,但我完全不知道从哪里开始实现这个目标。
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?
提前致谢
推荐答案
- (id) copyWithZone: (NSZone *) zone
{
return [[UIImage allocWithZone: zone] initWithCGImage: self.CGImage];
}
这篇关于使UIImage符合NSCopying协议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文