I knew I should have held off a few more minutes.
I was able to get this working. My issue was that my function calls for numberOfItemsInComboCell and comboBoxCell were wrong.
I fixed it by changing those two calls to;
func numberOfItems(in comboBox: NSComboBox) -> Int {
return Server_Locations.allCases.count
}
and
func comboBox(_ comboBox: NSComboBox, objectValueForItemAt index: Int) -> Any? {
return String(KeyboardHotKeys.allCases[index].rawValue) as AnyObject
}
so
numberOfItems(in: countryComboBox)
comboBox(countryComboBox, objectValueForItemAt: 0)
It is now complaining that I am not using the result of the call. Should I bother assigning the result to an empty value (ie: _ =) or is there something else I should be doing with it? The data is populating the NSComboBox as expected.
Topic:
Programming Languages
SubTopic:
Swift
Tags: