The essence of the application is to compare the current date with the specified one and display the text for each day (prayer time) ... Problem: when the application is in the background text for the current day it does not show. If you close the application and then open everything shows correctly. Help me please! THANK!
ViewController.h
@interface ViewController : UIViewController @property (weak, nonatomic) IBOutlet UITextField *utr; @property (weak, nonatomic) IBOutlet UITextField *voskh; @property (weak, nonatomic) IBOutlet UITextField *obed; @property (weak, nonatomic) IBOutlet UITextField *predz; @property (weak, nonatomic) IBOutlet UITextField *vecher; @property (weak, nonatomic) IBOutlet UITextField *noch; ViewController.m
- (void)viewDidLoad { [super viewDidLoad]; NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar]; NSDateComponents *comp0 = [[NSCalendar autoupdatingCurrentCalendar] components:NSCalendarUnitEra | NSCalendarUnitMonth | NSCalendarUnitDay fromDate:[NSDate date]]; NSDateComponents *comp1 = [calendar components:(NSCalendarUnitDay | NSCalendarUnitMonth ) fromDate:[NSDate date]]; NSDateComponents *comp2 = [calendar components:(NSCalendarUnitDay | NSCalendarUnitMonth ) fromDate:[NSDate date]]; NSDateComponents *comp3 = [calendar components:(NSCalendarUnitDay | NSCalendarUnitMonth ) fromDate:[NSDate date]]; NSDateComponents *comp4 = [calendar components:(NSCalendarUnitDay | NSCalendarUnitMonth ) fromDate:[NSDate date]]; [comp1 setDay:1]; [comp1 setMonth:1]; [comp2 setDay:2]; [comp2 setMonth:1]; [comp3 setDay:3]; [comp3 setMonth:1]; [comp4 setDay:4]; [comp4 setMonth:1]; if([comp1 day] == [comp0 day] && [comp1 month] == [comp0 month] ) { _utr.text=@"05:44"; _voskh.text=@"07:19"; _obed.text=@"11:58"; _predz.text=@"14:12"; _vecher.text=@"16:31"; _noch.text=@"18:01"; } if([comp2 day] == [comp0 day] && [comp2 month] == [comp0 month] ) { _utr.text=@"05:44"; _voskh.text=@"07:19"; _obed.text=@"11:58"; _predz.text=@"14:13"; _vecher.text=@"16:31"; _noch.text=@"18:01"; } if([comp3 day] == [comp0 day] && [comp3 month] == [comp0 month] ) { _utr.text=@"05:44"; _voskh.text=@"07:19"; _obed.text=@"11:59"; _predz.text=@"14:14"; _vecher.text=@"16:32"; _noch.text=@"18:02"; } if([comp4 day] == [comp0 day] && [comp4 month] == [comp0 month] ) { _utr.text=@"05:44"; _voskh.text=@"07:19"; _obed.text=@"12:00"; _predz.text=@"14:15"; _vecher.text=@"16:33"; _noch.text=@"18:03"; }