Thanks for your answer Kalpesh but actually after more trials I found that the best way to handle it is to have a pointer in the UITableViewCell to its controller and use it to get the new orientation then do the rearrangement in layoutSubviews:
@property(weak,nonatomic) UITableViewController *controller;
-(void) layoutSubviews
{
[super layoutSubviews];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){
// I am on a Phone
NSLog(@"The new controller orientation is: %u", self.controller.interfaceOrientation);
if(self.controller.interfaceOrientation == UIInterfaceOrientationPortrait){
NSLog(@"Phone - Controller orientation: Portrait.");
//Layout the subviews for portrait orientation
self.myLabel1.frame = CGRectMake(10,70,(self.frame.size.width-20)/4,20);
//..
} else{
NSLog(@"Phone - Controller orientation: Landscape.");
//Layout the subviews for landscape orientation
self.myLabel1.frame = CGRectMake(10,30,(self.frame.size.width-20)/4,20);
//..
}
} else if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad){
// I am on a Pad
if(self.controller.interfaceOrientation == UIInterfaceOrientationPortrait){
NSLog(@"Pad - Controller orientation: Portrait.");
//Layout the subviews for portrait orientation
} else{
NSLog(@"Pad - Controller orientation: Landscape.");
//Layout the subviews for landscape orientation
}
}
}
Anyway the refresh of the table as suggested by you can be useful to change the eight of the rows!
EDIT: The cell height is automatically reloaded when the orientation change so no need to force a reload of the table. Nicola