I have an array
of data with past and future events. when page load time the tableview scroll to the first future events. scroll down time shows the past events
-(void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
NSInteger index = 0;
if ([arryIndex count]!=0) {
NSNumber * indexPathData = [arryIndex objectAtIndex:index];
int number = [indexPathData intValue];
[tableEvents setContentOffset:CGPointMake(0.0, tableEvents.contentSize.height - tableEvents.bounds.size.height)animated:YES];
[tableEvents scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:number inSection:0]atScrollPosition:UITableViewScrollPositionTop animated:YES];
}
}