Im遵循一个教程,我不确定如何将此代码转换为在启用ARC的情况下无误地运行。iOS 5需要ARC桥接模型
- (void)setHourHandImage:(CGImageRef)image
{
if (image == NULL) {
hourHand.backgroundColor = [UIColor blackColor].CGColor;
hourHand.cornerRadius = 3;
}else{
hourHand.backgroundColor = [UIColor clearColor].CGColor;
hourHand.cornerRadius = 0.0;
}
hourHand.contents = (id)image;
给我一个错误的唯一部分是(id)图像;
另外
w = CGImageGetWidth((CGImageRef)hourHand.contents);
(CGImageRef)minHand.contents);给我一个错误
感谢
你会得到什么错误? – MobileOverlord 2012-03-02 01:51:15