Как разобрать Google Weather Api?

Я борюсь с долгое время, чтобы разобрать API погоды Google. Я использую парсер NSXML. но не получить решение. Я хочу получить значение города, темп, влажность, ближайшие дни.

Спасибо

ответ API здесь

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:     (NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict

{
  //if the element name is item then only i am assigning memory to the NSObject subclass
 if ([elementName isEqualToString:@""]) 
 {
   XMLStringFileObject = [[XMLStringFile alloc]init];
 }
}

- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{
 //what ever data i am getting from the node i am appending it to the nodecontent variable     after i trim that data for white space or new line character
 [nodecontent appendString:[string stringByTrimmingCharactersInSet:[NSCharacterSet     whitespaceAndNewlineCharacterSet]]];
}

- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
{
 //i am saving the data inside the properties of the XMLStringFileObject from the nodecontent variable
 if ([elementName isEqualToString:@"forecast_information"]) 
 {
  cityLabel.text =
 }
 else if ([elementName isEqualToString:@"current_condition"]) 
 {
   tempratureLabel.text=
   humidityLabel.text=
 }
 //finally in the end when the item tag is encountered i am adding the data inside the mutable array 
if([elementName isEqualToString:@""])
{

}

 //release the data from the mutable string variable
 [nodecontent release];

 //reallocate the memory to get the new data from the xml file
 nodecontent = [[NSMutableString alloc]init];
}

0 ответов

Другие вопросы по тегам