NSInternalInconsistencyException on systemLayoutSizeFittingSize

Originator:migrantp
Number:rdar://14520418 Date Originated:23 July 2013
Status:Closed Resolved:Yes
Product:iOS SDK Product Version:7.0
Classification:Crash Reproducible:Always
 
Summary: Dequeuing a UITableViewCell and calling systemLayoutSizeFittingSize can cause a NSInternalInconsistencyException on iOS 7, that does not happen on iOS 6.

Steps to Reproduce:
- The goal of the code is to create a table view cell that can expand vertically based on its content.
- Create a UITableViewController with a custom cell that has a label in it.
- Set constraints on the label such that its height is not fixed, but depends on the cell's height.
- In viewDidLoad:
  - Dequeue a cell.
  - Set the label's text.
  - Add a width constraint to the cell so it matches the table view's width.
  - Call systemLayoutSizeFittingSize:UILayoutFittingExpandedSize on the cell.

Expected Results: A CGSize is returned with the result.

Actual Results: A NSInternalInconsistencyException is generated with the reason 'Invalid parameter not satisfying: isfinite(c)' 

Regression: The problem occurs on iOS 7 beta, regardless of whether the app is built with Xcode 4 or Xcode 5. The problem does not occur on iOS 6.

Notes: Sample project that exhibits the crash is attached.

Comments

This is now fixed in iOS 7 beta 4 (11A4435d).


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!