I am following Ray Wenderlich's tutorial on implementing a rateView: http://www.raywenderlich.com/1768/how-to-make-a-custom-uiview-a-5-star-rating-view
After implementing a rateView into my app, I got this error:
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:0x870c2b0 h=--& v=--& V:[UIView:0x93a1d60(416)]", "NSLayoutConstraint:0x87363c0 V:|-(203)-[RateView:0x8729040] (Names: '|':UIView:0x93a1d60 )", "NSLayoutConstraint:0x8736440 V:[RateView:0x8729040]-(228)-| (Names: '|':UIView:0x93a1d60 )" )
Will attempt to recover by breaking constraint NSLayoutConstraint:0x8736440 V:[RateView:0x8729040]-(228)-| (Names: '|':UIView:0x93a1d60 )
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.
I downloaded the sample app that Ray provides, and it works perfectly for me, no errors. After searching through code, I don't see any differences, and my connections in Interface Builder are the same as his. The one significant difference was in the size inspector for our individual rate views. His looks like this:
while mine looks like this:
Considering that the error has to do with constraints this is probably the issue. However, I have no clue how to change my rateview to be autoresizing and such like Ray's. Help?
Uncheck "Use Autolayout" and try....
New Xcode 5 has new feature that awares us from different constaint values. I really appreciate this feature, it reduces errors and differences between that in storyboard and that in simulator and/or device.
Try to follow yellow triangle. It is is located in the left sidebar, when storyboard viewer opened. It brings three solutions how to fix the problem and it goes well and automatically.
So just update Frame, Constraints or reset to suggested constraints.
SOLUTION:
(if you don't see a left sidebar, in new xcode 5 it might be hidden, just click on the play icon):
Follow the yellow arrow first:
Then follow the yellow triange and after clicking on it you'll get the dialog:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With