私はxamarin & C#を使ってmacOSアプリケーションを開発しています。私はストーリーボードにNSComboBoxを持っています。それはコンセントを持っているので、私はそれにうまくアクセスできます。XAMARIN&C#でmacOS NSComboBoxにアイテムを追加する方法は?
私はこのようなリストに移入データコンテキスト持っている:私は、追加機能をNSComboBoxにこのリストを追加したい
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" });
を:
if(EarnArea_ComboBox.Count != 0) // If not empty.
{
EarnArea_ComboBox.RemoveAll(); // delete all items.
}
else // Empty.
{
EarnArea_ComboBox.Add(values.ToArray());
}
は、機能を追加するNSObjectのを追加サポートしています[ ]。文字列配列を与えると、次のエラーが発生します。
Error CS1503: Argument 1: cannot convert from 'string[]' to 'Foundation.NSObject[]' (CS1503)
NSComboBoxに項目を追加するにはどうすればよいですか?ありがとう。ココア(とiOS)コントロールが列/行ベースのデータを選択し、提示することを可能にするDataSource
性質を持っているの
ありがとう:)それは実行中です.... –
@BerkB。うれしかった – SushiHangover