Hi i am trying to change label text when changing segmented control.
Here's the code:
#import "FirstViewController.h"
@interface FirstViewController ()
@end
@implementation FirstViewController
@synthesize segmentedControl;
@synthesize distTf;
@synthesize weightLabel;
@synthesize spaceLabel;
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
if(segmentedControl.selectedSegmentIndex==0) {
weightLabel.text = @"Yards";
spaceLabel.text = @"Pounds";
} else if(segmentedControl.selectedSegmentIndex==1){
weightLabel.text = @"Meters";
spaceLabel.text = @"Kilograms";
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
It starts well when index = 0 but won't change if i select index = 1. Can you see what i can't?
Thanks all