如何区分Swift 3中具有相同名称的类成员的实例成员?什么是前通常现在的工作在Xcode中产生误差8的测试版5:在Swift 3中区分具有相同名称的实例成员的类
“静态成员‘文字颜色’不能在类型UITag的情况下被使用”
public class UITag : UILabel {
static var textColor = UIColor.white
override public init(frame: CGRect) {
super.init(frame: frame)
textColor = UITag.textColor /* error: static member cannot be used on instance of type UITag */
text = " not set "
}
}
消除静电,并尝试一次 –
注意添加明确self.textColor = UITag.textColor不帮助 –
@ Anbu.Karthik:静态不是实例的成员。 –