1

Edtion:

All sub views are placed in controller's xib. Everything is working fine till the time application is running in portrait mode in iPad simulator, as soon as the simulator get rotated its printing some warnings:

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:0x855f4c0 V:[MKNumberBadgeView:0x853fb70]-(743)-|   (Names: '|':UIView:0x855b3b0 )>",
"<NSLayoutConstraint:0x855f480 V:|-(5)-[MKNumberBadgeView:0x853fb70]   (Names: '|':UIView:0x855b3b0 )>",
"<NSAutoresizingMaskLayoutConstraint:0x76b48e0 h=-&- v=-&- UILayoutContainerView:0x8334f10.width == UIWindow:0x8334010.width>",
"<NSAutoresizingMaskLayoutConstraint:0x76b2ed0 h=-&- v=-&- UITransitionView:0x8336250.height == UILayoutContainerView:0x8334f10.height - 49>",
"<NSAutoresizingMaskLayoutConstraint:0x767e1d0 h=--- v=--- H:[UIWindow:0x8334010(768)]>",
"<NSAutoresizingMaskLayoutConstraint:0x7678c40 h=-&- v=-&- UIViewControllerWrapperView:0x76565f0.height == UITransitionView:0x8336250.height>",
"<NSAutoresizingMaskLayoutConstraint:0x7677290 h=-&- v=-&- UILayoutContainerView:0x83371a0.height == UIViewControllerWrapperView:0x76565f0.height>",
"<NSAutoresizingMaskLayoutConstraint:0x7675b60 h=-&- v=-&- UINavigationTransitionView:0x83398e0.height == UILayoutContainerView:0x83371a0.height>",
"<NSAutoresizingMaskLayoutConstraint:0x7674320 h=-&- v=-&- UIViewControllerWrapperView:0xf529bf0.height == UINavigationTransitionView:0x83398e0.height - 20>",
"<NSAutoresizingMaskLayoutConstraint:0x76729e0 h=-&- v=-&- UIView:0x855b3b0.height == UIViewControllerWrapperView:0xf529bf0.height>"
)
Will attempt to recover by breaking constraint <NSLayoutConstraint:0x855f4c0 V:[MKNumberBadgeView:0x853fb70]-(743)-|   (Names: '|':UIView:0x855b3b0    )>

I google out solution for this and find out setTranslatesAutoresizingMaskIntoConstraintsbut unlucky these warning are still there. Any suggestion/ help?

Sudha Tiwari
  • 2,499
  • 26
  • 50

1 Answers1

0

These two constraints:

V:|-(5)-[MKNumberBadgeView:0x853fb70]

V:[MKNumberBadgeView:0x853fb70]-(743)-|

Are telling the layout manager that you want an MKNumberBadgeView to be pinned 5 points from the top of it's superview and 743 points from the bottom. The iPad's screen is 768 points wide (or high, in landscape), and taking 20 points off that for the status bar only leaves you with 748 points. There isn't room in the layout to satisfy these constraints, unless your MKNumberBadgeView is zero points high.

You need to find the constraints in your xib and correct them. It seems unlikely that you actually need to pin the bottom of the badge view to the bottom of it's superview, pinning the top alone and having an intrinsic height should be fine.

Community
  • 1
  • 1
jrturton
  • 118,105
  • 32
  • 252
  • 268
  • ok i figured out. I just select the MKNumberBadgeView and the button lying beneath it and put vertical spacing in bwtween them. :) thanx. – Sudha Tiwari Aug 05 '13 at 14:52
  • ", "", "", "", "", Can u interpret this. I am still getting exception – Sudha Tiwari Aug 05 '13 at 14:52
  • See http://stackoverflow.com/questions/15874806/how-to-find-the-crashing-constraint/15875431#15875431 for how to interpret these logs – jrturton Aug 05 '13 at 14:57