如何删除[[UIColor greyColor] CGColor]
愚蠢的警告?
[self setValue:
[[UIColor grayColor] CGColor]
forKeyPath:[NSString stringWithFormat:@"_View_%@%d.layer.borderColor",
i>=10?@"":@"0", i]];
Incompatible pointer types sending 'CGColorRef' (aka 'struct CGColor *') to parameter of type 'id'
谢谢。
最佳答案
将 CGColor 转换为 id 类型:
[self setValue:
(id)[[UIColor grayColor] CGColor]
forKeyPath:[NSString stringWithFormat:@"_View_%@%d.layer.borderColor",
i>=10?@"":@"0", i]];
关于objective-c - 删除 UIColor CGColor - KVC 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13583644/