我用谷歌搜索了如何查找国家/地区列表并尝试实施public void process(){
addInfoMsg(summary, msgDetail); //Add msg func
RequestContext.getCurrentInstance().execute("setTimeout(function(){ $('#rdr-btn').click(); }, 3000);"); // 3 seconds delay. I put the script in Constants to config later.
}
,但我仍然陷入这一点,我尝试PickerView
它给了我一个错误说:
无法转换类型' int'的返回表达式返回类型' string' 有什么建议吗?
countries.count
答案 0 :(得分:2)
您需要在方法numberOfRowsInComponent
中返回数组计数,并在需要返回数组对象的titleForRow
中显示它将显示在选择器中。
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return countries.count
}
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
return countries[row]
}