I have the following view structure
[self view]
- [self stretchView]
- [[self slidingViewController] view]
- UISegmentedControl
- CPTGraphHostingView
The debugger shows the following dimensions (before layouting):
po [self view]
<UIView: 0x18c905b0; frame = (0 32; 480 288); autoresize = W+H; layer = <CALayer: 0x18ca5970>>
po [self stretchView]
<UIView: 0x18c8c250; frame = (0 0; 240 288); layer = <CALayer: 0x18cabf90>>
po [[self slidingViewController] view]
<UIView: 0x158ac920; frame = (240 0; 240 288); autoresize = W+H; gestureRecognizers = <NSArray: 0x18cf0b00>; layer = <CALayer: 0x18973fd0>>
po [[[self slidingViewController] view] subviews]
<__NSArrayM 0x18cf0b50>(
<UISegmentedControl: 0x189bfe10; frame = (50.5 20; 139 29); opaque = NO; layer = <CALayer: 0x189c1220>>,
<CPTGraphHostingView: 0x189ba8e0; frame = (0 68; 240 220); gestureRecognizers = <NSArray: 0x1897c900>; layer = <CALayer: 0x158ac8b0>>
)
During layouting I get the following error message:
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)
(
"<NSLayoutConstraint:0x188d19b0 V:|-(20)-[UISegmentedControl:0x189bfe10] (Names: '|':UIView:0x158ac920 )>",
"<NSLayoutConstraint:0x18cf06b0 CPTGraphHostingView:0x189ba8e0.bottom == UIView:0x158ac920.bottom>",
"<NSLayoutConstraint:0x18cf0720 V:[UISegmentedControl:0x189bfe10]-(20)-[CPTGraphHostingView:0x189ba8e0]>",
"<NSLayoutConstraint:0x15f5b170 V:|-(0)-[UIView:0x18c8c250] (Names: '|':UIView:0x18c905b0 )>",
"<NSLayoutConstraint:0x18cf4f20 UIView:0x18c8c250.height == UIView:0x18c905b0.height>",
"<NSLayoutConstraint:0x18ca8c70 V:[UIView:0x18c8c250]-(0)-[UIView:0x158ac920]>",
"<NSLayoutConstraint:0x15fd89b0 UIView:0x158ac920.bottom == UIView:0x18c905b0.bottom>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x18cf0720 V:[UISegmentedControl:0x189bfe10]-(20)-[CPTGraphHostingView:0x189ba8e0]>
The first layout constraint sets the segmented control 20 points below [[self slidingViewController] view]. The third one sets the top of CPTGraphHostingView to 20 points below the segmented control (with the current dimensions this results in 20+29+20+220 = 289 which is slightly larger than 288.
BUT: the second layout statement should also change the size of the CPTGraphHostingView by modifying the bottom.
Therefore, I do not understand why I get this error message.
BTW: The layouting works.
Best regards,
Hartwig