0

私の Mac OS X プロジェクトには、スライダーと「番号付き」の NSImageView アウトレットがいくつかあります。スライダーの値に応じて、対応する NSImageView に対処して、さらにアクションを実行したいと思います。

このようなもの:

sliderRed value == 1 -> red1  
sliderRed value == 2 -> red2  
sliderRed value == 3 -> red3  
sliderRed value == 4 -> red4
... and so forth

現時点では、これを行う方法がわかりません。また、ケース構成を使用したくありません。

これを行う方法はありますか?

@property (strong) IBOutlet NSSlider *sliderRed;

@property (strong) IBOutlet NSImageView *red1;
@property (strong) IBOutlet NSImageView *red2;
@property (strong) IBOutlet NSImageView *red3;
@property (strong) IBOutlet NSImageView *red4;
@property (strong) IBOutlet NSImageView *red5;
@property (strong) IBOutlet NSImageView *red6;
@property (strong) IBOutlet NSImageView *red7;
@property (strong) IBOutlet NSImageView *red8;
@property (strong) IBOutlet NSImageView *red9;
@property (strong) IBOutlet NSImageView *red10;
@property (strong) IBOutlet NSImageView *red11;
@property (strong) IBOutlet NSImageView *red12;
@property (strong) IBOutlet NSImageView *red13;
@property (strong) IBOutlet NSImageView *red14;
@property (strong) IBOutlet NSImageView *red15;
4

2 に答える 2