My app subclasses a UITableViewCell
and implements layoutSubviews
to modify the cell's contentView
's width, like so:
- (void)layoutSubviews {
[super layoutSubviews];
// position subviews...
CGRect frame = [[self contentView] frame];
frame.size.width -= 20;
[[self contentView] setFrame:frame];
}
When running this code with the iOS 8 simulator and Xcode 6 GM seed, this triggers an infinite loop. However, when running on a real iPhone or iPad running iOS 8 GM seed, it does not loop, as in previous versions of iOS.
I first thought the difference was a compiler optimization, but the simulator loops in both debug configuration and release configuration.
Questions
- Why the difference between the iOS 8 GM and the simulator?
- Is this a critical bug fix? I'm very reluctant to release an app that exhibits a potentially serious hanging bug, even if I can't reproduce it on device.
- What in your opinion is the best way to refactor this to eliminate the looping without causing regression on iOS 7 and 6?