gpt4 book ai didi

ios - 不能在属性初始值设定项 DropDown 库中使用实例成员

转载 作者:行者123 更新时间:2023-11-28 08:02:22 24 4
gpt4 key购买 nike

<分区>

我已经实现了 assistolab我的项目中的下拉列表。但在某些 View Controller 中它无法正常工作。它显示,

cannot use instance member within property initializer my code snippet is given below

class MobileTopUpVC: UIViewController,UITextFieldDelegate {

let dropDown = DropDown() //error is here

@IBOutlet weak var mobileTopUpImag: UIImageView!
@IBOutlet weak var amountTxt: UITextField!
@IBOutlet weak var mobileNumberTxt: UITextField!
@IBOutlet weak var operatorTxt: UITextField!
@IBOutlet weak var countryTxt: UITextField!
@IBOutlet weak var DropDown: UIView!

@IBOutlet weak var backGroundView: UIView!
var textArray = [UITextField]()
var countryArray:[String] = colors.countryArray
var operatorArray:[String] = colors.opArray





@IBOutlet weak var proceedButton: UIButton!

override func viewDidLoad() {
super.viewDidLoad()




backGroundView.layer.cornerRadius = backGroundView.frame.width/2
backGroundView.clipsToBounds = true
//countryArray = colors.countryArray
backGroundView.layer.borderWidth = 3
backGroundView.layer.borderColor = colors.second.cgColor
textArray = [countryTxt,operatorTxt,amountTxt,mobileNumberTxt]
let view1:UIView! = UIView()

view1.frame = CGRect(x: 0, y: 0, width: 0, height: 0)

countryTxt.inputView = view1
operatorTxt.inputView = view1
// countryTxt.layer.borderWidth = 1
// countryTxt.layer.borderColor = UIColor.green.cgColor
// countryTxt.borderStyle = UITextBorderStyle.bezel
borderStyle()
proceedButton.Cradius(size: 15.0)
mobileTopUpImag.image = mobileTopUpImag.image?.withRenderingMode(.alwaysTemplate)
mobileTopUpImag.tintColor = colors.second
countryDropDown()
}

这一行的错误困扰着我

let dropDown = DropDown()

请帮我解决这个问题

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com