I'm using Xamarin & C# to develop a macOS application. I have a NSComboBox in the storyboard. It have an outlet, so i can access to it successfully.
I have an data context which populated in a list like this:
public static List<string> bloomTypes_EN = new List<string>(new string[] {
"Cognitive Memory",
"Cognitive Understanding",
"Cognitive Practice",
"Cognitive Analysis",
"Cognitive Evaluation",
"Cognitive Generation",
"Affective Reception",
"Affective Behavior",
"Affective Valuing",
"Affective Organization",
"Affective Character Making",
"Psychomotor Perception",
"Psychomotor Organization",
"Psychomotor Guided Behavior",
"Psychomotor Mechanization",
"Psychomotor Complex Behavior",
"Psychomotor Harmony",
"Psychomotor Generation" });
I want add this list into the NSComboBox with Add function:
if(EarnArea_ComboBox.Count != 0) // If not empty.
{
EarnArea_ComboBox.RemoveAll(); // delete all items.
}
else // Empty.
{
EarnArea_ComboBox.Add(values.ToArray());
}
Add functions supports add NSObject[]. Giving string array causes this error:
Error CS1503: Argument 1: cannot convert from 'string[]' to 'Foundation.NSObject[]' (CS1503)
How can I add item to NSComboBox ? Thanks.