I have a UITableView in my iOS application, and depending on the device (iPhone or iPad), I size different items on my UITableView's contentViews.
For example, every cell's contentView has something called a valueLabel. Depending on the device, I size it properly:
if(IDIOM == IPAD)
valueLabel = [[[UILabel alloc] initWithFrame: CGRectMake( 430.0, 0.0, 216, 44.0 )] autorelease];
else
valueLabel = [[[UILabel alloc] initWithFrame: CGRectMake( 165.0, 0.0, 80, 44.0 )] autorelease];
Then, I configure the label (color, font, etc) and after that, I have the following lines of code:
if(IDIOM != IPAD)
valueLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight;
Turns out, when I first wrote this, I was smart for doing this. But I can't remember why. I'm trying to make an update which supports landscape mode on both the iPhone and iPad. But only the UITableView on the iPhone sizes properly in landscape mode, because for the iPad, I don't have Autoresizing. How can I have autoresizing on the iPad?
If I remove the condition if(IDIOM != IPAD)
, the labels don't even show up, and my cells are empty.