So i’ve a class “mainpercentage.m”, and I want one variable in that class assume a value of ComboBox index. I’ve tried method “indexOfSelectedItem”, but I can not understand the syntax.
Thank’s for help!
Mainpercentage.m:
@implementation MainPercentage
- (IBAction)SetPercentage:(id)sender {
/*
Here I want get index of my ComboBox
*/
if (1==1) {
[pryam setIntValue:40]; //pryam- FormCell
[razb setIntValue:30];
[estestv setIntValue:30];
}
}
- (IBAction)GetKon:(id)sender {
}
@end
Mainpercentage.h:
#import <Cocoa/Cocoa.h>
@interface MainPercentage : NSObject {
IBOutlet id estestv;
IBOutlet id pryam;
IBOutlet id razb;
}
- (IBAction)SetPercentage:(id)sender;
@end
From the docs:
So if you have an
NSComboBox, let’s call itmyCombo, you would say this:Now indexInteger is an
NSIntegerwhose value is the index.