Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下代码:
UIImage *originalImage; CGImageRef cgImage = [originalImage CGImage];
我知道CGImage是UIImage类的只读属性。是否行
CGImageRelease(cgImage)
释放originalImage的内存?
我正在追踪我的程序中的一个错误,如果我稍后尝试访问originalImage ,这条线似乎是一个热门候选者。
谢谢,斯特凡
我自己找到了答案:因为电话
CGImageRef img = [[UIImage imageNamed:@"pic.png"] CGImage];
不包含单词create、copy或alloc之一,我不负责释放此内存。