La vue de la Table de la cellule de l'expansion dans IOS 7

Je développe une application iOS. J'ai utilisé un tableau de la vue. Lorsque l'utilisateur clique sur une cellule, la cellule se développe. Mais certaines cellules ne sont pas en expansion dans iOS 7. D'autres versions de s'exécuter correctement. Ci-dessous est un exemple de code. Comment puis-je la corriger?

- (BOOL)cellIsSelected:(NSIndexPath *)indexPath {
//Return whether the cell at the specified index path is selected or not
NSNumber *selectedIndex = [selectedIndexes objectForKey:indexPath];
return selectedIndex == nil ? FALSE : [selectedIndex boolValue];
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if([self cellIsSelected:indexPath])
{
return 111;
}
//Cell isn't selected so return single height
return 41;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return  [self.filteredItineraries count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"FlightTracker";
CellFlightTracker *cell = (CellFlightTracker *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if(cell == nil)
{
NSArray *nib=nil;
nib = [[NSBundle mainBundle] loadNibNamed:@"CellFlightTracker" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
if([self cellIsSelected:indexPath])
{
cell.backgroundColor=[UIColor blackColor];
}else
{
cell.backgroundColor=[UIColor darkGrayColor];
}
return cell;
}
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
if([self cellIsSelected:indexPath])
cell.backgroundColor= [UIColor blackColor];
else
cell.backgroundColor= [UIColor darkGrayColor];
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[tableView deselectRowAtIndexPath:indexPath animated:TRUE];
//Toggle 'selected' state
BOOL isSelected = ![self cellIsSelected:indexPath];
//Store cell 'selected' state keyed on indexPath
NSNumber *selectedIndex = [NSNumber numberWithBool:isSelected];
[selectedIndexes setObject:selectedIndex forKey:indexPath];
//This is where magic happens...
[tableView1 beginUpdates];
CellFlightTracker *selectedCell = (CellFlightTracker*)[tableView cellForRowAtIndexPath:indexPath];
if(selectedCell.lblDepartureAirportStatus.hidden)
[selectedCell.lblDepartureAirportStatus setHidden:NO];
else
[selectedCell.lblDepartureAirportStatus setHidden:YES];
[tableView1 endUpdates];
}
Il serait utile de voir la mise en œuvre de cellIsSelected: ...
Tout comme un test, pourriez-vous commenter [tableView deselectRowAtIndexPath:indexPath animated:TRUE] ou essayer de la remplacer par [tableView deselectRowAtIndexPath:indexPath animated:NO]? J'ai eu des problèmes avec empilées les animations dans la vue tableau de cellules.
J'ai essayé, mais ne fonctionne pas :/

OriginalL'auteur hiwordls | 2013-10-01