Just started learning iOS AutoLayout, Interface builder very straight forward, but when I try to archive the same thing on the code
[self.view addConstr
It may be not so difficult.The message console output says that the UIButton's constraints redefined.It means just like that you put a constraint that restrict the Height
and the Width
of the button, but needlessly you put another restriction that the button has a Aspect Ratio
.In this condition Xcode can't make sure which constraint to follow,so that you can see this debug message in console.
There are two ways Useful for me:
2.If you are using the storyboard
or Xib
,Select a constraint ->Show the Attributes Inspector -> change the priority of some Constraints.
One more thing...
You can follow the article of Jason Jarrett. Add a symbol breakpoint to make sure which view make the error happen.