CustomView의 IBOutlet이 0으로 표시됩니다.Exc_Bad_Access Xib에서 CustomView를로드하는 중
사용자 정의보기 (xib)를 만들었습니다.
자세한 내용은 이미지를 참조하십시오.
class TextFieldView: UIView {
@IBOutlet var contentView: TextFieldView!
@IBOutlet weak var customTextField: UITextField!
@IBOutlet weak var rightButton: UIButton!
@IBOutlet weak var placeHolderLabel: UILabel!
override init(frame: CGRect) {
super.init(frame: frame)
commonInit()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
commonInit()
}
override func awakeFromNib() {
super.awakeFromNib()
}
func commonInit()
{
let bundle = Bundle(for: type(of: self))
bundle.loadNibNamed("TextFieldView", owner: self, options: nil)
customTextField.backgroundColor = UIColor.green
NSLog("Called")
}
아직도 EXC_BAD_ACCESS와 오류를 던지고
어떤 이미지? XIB에이 콘센트를 연결 했습니까? –