.h file:
@property (strong, nonatomic) IBOutlet UILabel *frequencyDetailLabel;
.m file:
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
//LOCALIZATION
..
self.frequencyDetailLabel.text = NSLocalizedString(@"Select", nil);
}
Then later in my code I try changing the text:
self.frequencyDetailLabel.text = NSLocalizedString(@"Done", nil);
Things I have done so far:
- Made sure the
IBOutlet
connection is working properly. - Instead of changing the text, I tried changing the
textcolor
and it worked. - Check if the
UILabel
was null/nil, it is not. - Made sure both were pointing at same UILabel
- In my localizable.strings, both Keys exists.
Anything else I should try?
Edit:
unwind method
- (IBAction)unwindFromFrequencyViewController:(UIStoryboardSegue *)segue {
if ([segue.sourceViewController isKindOfClass:[FrequencyTableViewController class]]) {
FrequencyTableViewController *frequencyViewController = segue.sourceViewController;
// if the user clicked Cancel, we don't want to set a frequency (skips code)
if (frequencyViewController.frequency) {
NSLog(@"THIS RAN");
self.howOften = frequencyViewController.frequency;
if ([frequencyViewController.frequency intValue] == 1) {
NSLog(@"THIS RAN1");
self.frequencyDetailLabel.text = @"Every day";
return;
} else {
NSLog(@"THIS RAN2");
self.frequencyDetailLabel.text = NSLocalizedString(@"Done", nil);
}
}
}
}