I'm retrieving a value from JSON in NSArray format. It's temperature.
However it is in Celsius and I wish to convert it to Kelvin. All I need to do is add 274.15. I'm not really able to do that since it's NSArray and I can't add directly.
I tried converting to NSString and then converting to double however it seems like I don't have that option.
This is the current code:
NSDictionary *temp = [currentDate objectForKey:@"temp"];
NSArray* maxTemp = [temp objectForKey:@"max"];
NSLog(@"Max Temp : %@ Kelvin",maxTemp );
NSArray* minTemp = [temp objectForKey:@"min"];
NSLog(@"Min Temp : %@ Kelvin",minTemp);
All I wanna do is get ( maxTemp + 274.15 )
Current values in Celsius:
Max Temp : 28.8 Kelvin
Min Temp : 26.55 Kelvin