I want to check if the users device is an iPhone 4 or 5 and then set the height of a tableView. The xCode simulator recognizes that it is an iPhone 4 the message 'iPhone 4' is shown, but the height of the tableView stays the same. What am I doing wrong?
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
// iPhone 4
NSLog(@"iPhone 4");
myTableView.frame = CGRectMake(0, 44, 320, 200);
}
if(result.height == 568)
{
// iPhone 5
self.myTableView.frame = CGRectMake(0, 44, 320, 288);
}
}