Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/107.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 无法转换类型为';[CustomObject]';到预期的参数类型';["]和"x27 ;;_Ios_Swift_Xcode_Generics_Swift3 - Fatal编程技术网

Ios 无法转换类型为';[CustomObject]';到预期的参数类型';["]和"x27 ;;

Ios 无法转换类型为';[CustomObject]';到预期的参数类型';["]和"x27 ;;,ios,swift,xcode,generics,swift3,Ios,Swift,Xcode,Generics,Swift3,这是类声明: class VXDropdownFormRow<T: SelectableOption>: DropdownFormRow<T> where T: Equatable { override init(title: String?, options: [T], selectedOption: T?, cellSelection: FormCellSelectionClosureType?, valueChanged: ((FormRow) ->

这是类声明:

class VXDropdownFormRow<T: SelectableOption>: DropdownFormRow<T> where T: Equatable {
    override init(title: String?, options: [T], selectedOption: T?, cellSelection: FormCellSelectionClosureType?, valueChanged: ((FormRow) -> Void)?) {
        super.init(title: title, options: options, selectedOption: selectedOption, cellSelection: cellSelection, valueChanged: valueChanged)
        self.cellHeight = 74
    }
}
符合协议
SelectableOption
,如类声明中所述:

open class ListItem: NSManagedObject, SelectableOption {
    func setValues(fromJSON json: JSON, sortOrder: Int) {
        defaultValue = json["default"].stringValue == "true" ?  (true) : (false)
        value = json["value"].stringValue
        text = json["text"].stringValue
        localSortOrder = (sortOrder as NSNumber?)
    }
    public func selectableOptionTitle() -> String {
        return self.text!
    }
    public func selectableOptionSectionTitle() -> String {
        return ""
    }

} 
但是编译器在生成时抛出一个错误:

Cannot convert value of type '[ListItem]' to expected argument type '[_]'


我应该做什么来修复此错误

我通过修复文件中设置为
VXDropdownFormRow
的原始声明,解决了这个问题。请检查申报单,确保一切正常。此错误具有误导性,无法帮助您发现问题

您是否尝试过
VXDropdownFormRow(标题:…)
?没有帮助。同样的错误。
Cannot convert value of type '[ListItem]' to expected argument type '[_]'