Hi,
In my tableView at the numberOfRowInSection, I try to compare myDate inside self.date to dateInFiche inside self.allDates.
my date is like: 12-05-1986
in the For statement dateinFiche will have those value:
12-05-1986
12-05-1986
13-05-1986
18-05-1986
When the if statement occurs the first date is the same so it will increment the numberofRows, the second is also the same but the problem is the if didn't want to be executed at this point.
I use a breakpoint and the value are the same but the if not working. Any idea?
(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
NSString *myDate = [self.date objectAtIndex:section];
int numberOfRows = 0;
for (int i = 0; i [self.allDates count]; i++) {
Date *dateFiche = (Date *)[self.allDates objectAtIndex:i];
NSString *dateInFiche = [[dateFiche sDate] substringWithRange: NSMakeRange( 0,10)];
if ( dateInFiche == myDate )
{
numberOfRows = numberOfRows+1;
}
}
return numberOfRows;
}