ビューの配列で埋めるスタックがあります。
_countViewArray = [[NSArray alloc] init];
_countViewArray = @[self.a.view,self.b.view,self.c.view];
_stackView = [NSStackView stackViewWithViews:_countViewArray];
よく効きます。この配列を変更可能な配列に置き換えたい場合、どうすればよいですか?
「動的」スタックビューでこのコードを試し、最終的に可変配列を単純な配列に変換しましたが、機能しません:
_mutableCountViewArray = [[NSMutableArray alloc] init];
[_mutableCountViewArray addObject:@[self.a.view]];
if (caseCondition){
[_mutableCountViewArray addObject:@[self.b.view]];
}
[_mutableCountViewArray addObject:@[self.c.view]];
_countViewArray = [_mutableCountViewArray copy];
_stackView = [NSStackView stackViewWithViews:_countViewArray];
私が持っている可変配列を出力する場合、consolleで:
(
(
"<NSView: 0x600000121ea0>"
),
(
"<NSView: 0x600000120780>"
,
(
"<NSView: 0x6000001235a0>"
)
)
どうすれば解決できますか?