I have a UITableView
. I want to make animation when cell is loading in table. I make it like this.
-(void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
CGRect tmpFrame;
CGRect originalFrame;
originalFrame = cell.frame;
tmpFrame = cell.frame;
tmpFrame = CGRectMake(0, -50, 320, 50);
cell.frame = tmpFrame;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:5.0f];
[UIView setAnimationBeginsFromCurrentState:YES];
UIView* separatorLineView = [[UIView alloc] initWithFrame:CGRectMake(0, 50, 320, 1)];
separatorLineView.backgroundColor = [UIColor lightGrayColor];
[cell.contentView addSubview:separatorLineView];
cell.frame = originalFrame;
[UIView commitAnimations];
}
This code is working fine in iOS 6 (iPhone simulator 6) but it's not working in iOS 5.1 (iPhone simulator 5.1).