From my parent view controller I am presenting a modal viewcontroller, from the modalview user can selects his country,city,latitude and longitude etc., and the values are displayed in the next modal view, if user clicks done button in the modal view I need to update the labels in the parent view controller after doing some calculation, but the values are not updating my labels, here are the codes,
//done method in modal view controller
- (IBAction)doneButtonClicked:(id)sender {
NSLog(@"Before Done %@ %@ %f %f %f %f",_finalCountryName,_finalCityName,_finalCityLatitude,_finalCityLongitude,_finalCityTimezone,_finalCityDaylight);
//opening screen is my parent view controller
OpeningScreen *open = [[OpeningScreen alloc]init];
[open rebackInitialisation];
[open manualSalatCalculation:_finalCityLatitude manLong:_finalCityLongitude manTz:_finalCityTimezone manDls:_finalCityDaylight];
[self dismissViewControllerAnimated:YES completion:nil];
}
//method in parent view controller (OpeningScreen)
-(void)manualSalatCalculation:(double)manLat manLong:(double)manLon manTz:(double)manTz manDls:(double)manDls {
NSLog(@"Manual Values are %f %f %f %f",manLat,manLon,manTz,manDls); ========>>> Here values are coming
if (!manLat == 0.0 && !manLon == 0.0) {
double tZone =0.0;
if([curDayLightStatString isEqualToString:@"Disable"]) {
tZone = manTz;
}
if([curDayLightStatString isEqualToString:@"Enable"]) {
tZone = manTz + manDls;
}
NSDateComponents *components = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:[NSDate date]];
self.manualTimesArray = [prayCalc getPrayerTimes:components andLatitude:manLat andLongitude:manLon andtimeZone:tZone];
NSLog(@"manual calculated array values are %@",self.manualTimesArray); =======================>>> Here values are not coming so not updating my labels
first.text = [NSString stringWithFormat:@"%@",[self.manualTimes objectAtIndex:0]];
second.text = [NSString stringWithFormat:@"%@",[self.manualTimes objectAtIndex:2]];
third.text = [NSString stringWithFormat:@"%@",[self.manualTimes objectAtIndex:3]];
fourth.text = [NSString stringWithFormat:@"%@",[self.manualTimes objectAtIndex:5]];
fifth.text = [NSString stringWithFormat:@"%@",[self.manualTimes objectAtIndex:6]];
}
}