在我的 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;