我最近使用自动参考计数(ARC)开始了一个新项目.
当我分配CALayer的内容时:
UIView* view = ...
UIImage* image = ...
view.layer.contents = image.CGImage
Run Code Online (Sandbox Code Playgroud)
我收到了一个错误
使用ARC不允许将非Objective-C指针类型'CGImageRef'隐式转换为'id'
简单地铸造CGImageRef到id隐藏的错误,但我想知道如果ARC仍然正常工作呢?
core-animation core-graphics objective-c ios automatic-ref-counting