how to match nsxml dates from parser and get only the required dates
<p>I am working on an nsxml parser and I have some issues.I am using nsxml parser to parse dates out.I want to get information of only 2 days .not all 4 from google weather api.How can I do it?</p>

<pre><code>NSMutableArray *array=[NSMutableArray arrayWithObjects:startDate,endDate,Nil];
for (NSDate *date in array)
{
     if([date isEqualToDate:dd])
     {
         NSManagedObject *allnew = Nil;
         NSManagedObjectContext *allone=[self managedObjectContext];            
         NSEntityDescription *entity = [NSEntityDescription entityForName:@"Weather" inManagedObjectContext:allone];   
         NSLog(@" The NEW ENTITY IS ALLOCATED AS entity is %@",entity);
         WeatherXMLParser *delegate = [[WeatherXMLParser alloc] initWithCity:city state:state country:country];
         NSXMLParser *locationParser = [[NSXMLParser alloc] initWithContentsOfURL:delegate.url];
         [locationParser setDelegate:delegate];
         [locationParser setShouldResolveExternalEntities:YES];
         [locationParser parse];
         NSFetchRequest *request = [[NSFetchRequest alloc] init];  
         [request setEntity:entity]; 

         predicate = [NSPredicate predicateWithFormat:
                                    @"city == %@ and state == %@ and country == %@  and date==%@ and date==%@", city, state, country,startDate,endDate];
         [request setPredicate:predicate];
         NSError *err;
         NSUInteger count = [allone countForFetchRequest:request error:&amp;err];
         NSLog(@" minimum salary is %@",predicate);
         // If a predicate was passed, pass it to the query
         if(predicate !=NULL){
              [self deleteobject];
         }

         Weather *weather = (Weather *)[NSEntityDescription insertNewObjectForEntityForName:@"Weather" 
                                                                                   inManagedObjectContext:self.managedObjectContext];
         weather.date = [fields objectForKey:@"date"];
         weather.high =[fields objectForKey:@"high"];
         weather.low = [fields objectForKey:@"low"];
         weather.city =[fields objectForKey:@"city"];
         weather.state =[fields objectForKey:@"state"];
         weather.country =[fields objectForKey:@"country"];
         NSString*icon=[fields objectForKey:@"icon"];
         NSString *all=[icon lastPathComponent];
         weather.condition = all;

         [self saveContext]; 
     }
</code></pre>
