myView = [[UIView alloc] init];
myView.layer.borderColor = [UIColor colorWithPatternImage:@"color.png"];
第二行给出错误 将 OBjective-C 指针类型"UIColor"隐式转换为指针类型"CGColorRef"需要桥接转换.
此错误是什么以及如何解决它。
该行应为:
myView.layer.borderColor = [[UIColor colorWithPatternImage:@"color.png"] CGColor];
因为您有UIColor
但该图层(如错误所述(需要CGColorRef
。