title: How to parse Google weather API using NSXML?
body: <p>i want to parse google weather API using NSXML so please give me some Guidance for this.</p>
  
  <p>This is <a href="http://www.google.com/ig/api?weather=Ahemdabad" rel="nofollow noreferrer">My url</a></p>
  
  <p>and i have taken such kind of steps:</p>
  
  <pre><code>NSURL *url = [NSURL URLWithString:@"http://www.google.com/ig/api?weather=Ahemdabad"];
  
   NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
   [theRequest setHTTPMethod:@"POST"];
   NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
  
   if(theConnection){
    webData = [[NSMutableData data] retain];
    NSLog( @"connection established");
   }
   else {
    NSLog(@"theConnection is NULL");
   }
  </code></pre>
  
  
  
  <pre><code>-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
  {
   [webData setLength: 0];
  }
  
  -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
  {
   [webData appendData:data]; 
  }
  
  -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
  {
   NSLog(@"ERROR with theConenction");
   [connection release];
   [webData release];
  }
  
  -(void)connectionDidFinishLoading:(NSURLConnection *)connectio   
  {     
      NSLog(@"DONE. Received Bytes: %d", [webData length]);
  
   NSString *theXML = [[NSString alloc] initWithBytes: [webData mutableBytes] length:[webData length] encoding:NSUTF8StringEncoding];
   NSLog(@"thexml=============&gt;%@", theXML);
   [theXML release];
  
  
   if(parser)
   {
    [parser release];
   }
  
   parser = [[NSXMLParser alloc]initWithData:webData];
   [parser setDelegate: self];
   [parser setShouldResolveExternalEntities: YES];
   [parser parse];
  
   [connection release];
   [webData release];
  
  }
  </code></pre>