如何區分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:靜態不是實例的成員。 –