This works perfect
-(void)extendTableView
{
if (searchPanel) {
CGRect screenRect = [[UIScreen mainScreen] bounds];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
objectsTableView.frame = CGRectMake(0, 0, screenRect.size.width, screenRect.size.height);
[UIView commitAnimations];
}
}
-(void)shrinkTableView
{
if (searchPanel) {
CGRect screenRect = [[UIScreen mainScreen] bounds];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
objectsTableView.frame = CGRectMake(0, 100, screenRect.size.width, screenRect.size.height -100);
[UIView commitAnimations];
}
}