Skip to content

Going back to a tab when it is showing a nested navigation stack causes an auto layout exception #19

@rastersize

Description

@rastersize

The app crashes halts at a debug exception the second time the “My Profile” tab is shown.

Steps to reproduce

  1. Tap “My Profile” tab.
  2. Tap on any other tab.
  3. Tap “My Profile” tab again.
  4. Crash

The crash

The crash occurs in the -[AKTabBarView setContentView:] method on line 47 due to some contradicting auto layout constraints in the OPFUserProfileViewController.

2013-05-01 16:07:43.868 Code Stream[96082:c07] Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x13c54f20 h=--& v=--& H:[UITableViewCell:0xa246ed0(0)]>",
    "<NSLayoutConstraint:0x13c4bac0 UIWebView:0xa26f620.leading == UITableViewCell:0xa246ed0.leading + 10>",
    "<NSLayoutConstraint:0x13c50280 UITableViewCell:0xa246ed0.trailing == UIWebView:0xa26f620.trailing + 10>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x13c50280 UITableViewCell:0xa246ed0.trailing == UIWebView:0xa26f620.trailing + 10>

Break on objc_exception_throw to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

Possible fixes

  • Investigate if it is AKTabBarController which is incompatible with auto layout and in such case fix AKTabBarController.
  • Change all of our views to use springs and struts instead of auto layout. Most likely a huge task!

/cc @tdeekens

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions