类型转换为ID解决问题: “Collection element of type 'CGColorRef' (aka 'struct CGColor *') is not an Objective-C object”
编译器理解Objective-C方法返回的核心基础类型遵循历史可命名约定(见-高级内存管理编程指南)。例如,编译器知道,在iOS的cgcolor返回用UIColor的cgcolor方法不拥有。您必须仍然使用一个合适的类型转换,
1down voteaccepted | It is documented in the "Transitioning to ARC Release Notes":
|
参考:http://stackoverflow.com/questions/21933209/why-type-cast-to-id-will-get-rid-of-this-error-message-collection-element-of-ty