Сначала выберите лучший API погоды для вашей цели:
https://stackoverflow.com/questions/507441/best-weather-apis
Большинство API, включая Google, возвращают свои результаты в формате XML.
Кратко написанный пример кода, который поможет вам начать работу с Google Weather API:
NSString * location = @"Amsterdam";
NSString * address = @"http://www.google.co.uk/ig/api?weather=";
NSString * request = [NSString stringWithFormat:@"%@%@",address,location];
NSURL * URL = [NSURL URLWithString:request];
NSError * error;
NSString* XML = [NSString stringWithContentsOfURL:URL encoding:NSASCIIStringEncoding error:&error];
// Extract current temperature the 'dirty' way
NSString * temp = [[[[XML componentsSeparatedByString:@"temp_c data=\""] objectAtIndex:1] componentsSeparatedByString:@"\""] objectAtIndex:0];
NSLog(@"It's currently %@ degree in %@.", temp, location);
// Parse the XML with NSXMLDocument to extract the data properly
NSXMLDocument * doc = [[NSXMLDocument alloc] initWithXMLString:XML options:0 error:NULL];
Выход:
Сейчас в Амстердаме 14 градусов.