UITextField not showing up on View Controller - ios

I've added a simple UITextView and i placed it where i want to in the storyboard, then i click on add missing contraints/reset to suggested and it doesn't show up on the screen when i run it, i don't know why its not working
this is what i get in the debugger.
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)
(
"<_UILayoutSupportConstraint:0x15ed61540 V:[_UILayoutGuide:0x15eee5f50(20)]>",
"<_UILayoutSupportConstraint:0x15ed0c500 V:|-(0)-[_UILayoutGuide:0x15eee5f50] (Names: '|':UIView:0x15eee5df0 )>",
"",
"",
"" )
Will attempt to recover by breaking constraint
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in may also be helpful.

Using the "add suggested constraint" is usually not a good idea. I really recommend that you study more about auto-layout and adaptive layout. I'd need to know exactly how you want to position and size you UITextField to determine what is the conflicting constraint for your case, it would be important to know what other views you have in your view controller that might be affecting the text field.

Related

What are these warnings in my console?

I am having the following error in my console.I don't know what are they.
2015-03-24 13:57:43.213 automobile[5454:530574] 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:0x174284880 V:[_UILayoutGuide:0x1741b8e20]-(238)-[UIButton:0x12ee424c0'Retry']>",
"<NSLayoutConstraint:0x174284740 V:[UIButton:0x12ee424c0'Retry']-(236)-[_UILayoutGuide:0x1741b8f00]>",
"<_UILayoutSupportConstraint:0x1740aeb80 V:[_UILayoutGuide:0x1741b8e20(50.66)]>",
"<_UILayoutSupportConstraint:0x1740aebe0 V:|-(0)-[_UILayoutGuide:0x1741b8e20] (Names: '|':UIView:0x174185bd0 )>",
"<_UILayoutSupportConstraint:0x1740aee80 V:[_UILayoutGuide:0x1741b8f00(0)]>",
"<_UILayoutSupportConstraint:0x1740aee20 _UILayoutGuide:0x1741b8f00.bottom == UIView:0x174185bd0.bottom>",
"<NSLayoutConstraint:0x174289d30 'UIView-Encapsulated-Layout-Height' V:[UIView:0x174185bd0(375)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x174284880 V:[_UILayoutGuide:0x1741b8e20]-(238)-[UIButton:0x12ee424c0'Retry']>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
Anyone who know this?Any Help?
It seems you have conflicting constraints on your views.
If you are using Interface Builder, I suggest your click on the Red or Yellow arrows in your VC scene and Xcode should give you more details as to what constraints are causing the issue.
You can see here http://i.stack.imgur.com/5lbp8.png and here http://i.stack.imgur.com/qjvFL.png how this should appear in Xcode.
I suggest you start by reconsidering the constraints and try to keep the minimum that satisfy your layout.
I hope this helps

Auto layout unable to satisfy constraints when activating a segue

I have a custom table view cell with constraints suggested by Auto Layout. In the storyboard all the constraints are marked with blue lines indicating that they have no errors. The tableview launches fine and the layout works but as soon as I hit the cell to activate a segue I get this:
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.
I have not added any code that adds or removes constraints to my layout. All the constraints were auto-added by Auto layout.
The error only shows up when I hit the cell which activates a segue to take the user to the next view. When I hit the back button, the tableview returns but without any constraints.
The segue is set as Show(e.g. Push) in the Attributes Inspector.
Here's the rest of the message:
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x7ff1c276fec0 UIImageView:0x7ff1c2496b40.top == UITableViewCellContentView:0x7ff1c2496630.topMargin + 15>",
"<NSLayoutConstraint:0x7ff1c276ff10 UIImageView:0x7ff1c2496b40.centerY == UITableViewCellContentView:0x7ff1c2496630.centerY>",
"<NSLayoutConstraint:0x7ff1c24c9a70 'UIView-Encapsulated-Layout-Height' V:[UITableViewCellContentView:0x7ff1c2496630(43.5)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7ff1c276ff10 UIImageView:0x7ff1c2496b40.centerY == UITableViewCellContentView:0x7ff1c2496630.centerY>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2015-01-06 11:35:58.645 FitLift[4174:130902] 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:0x7ff1c2494c00 UIImageView:0x7ff1c277c070.top == UITableViewCellContentView:0x7ff1c277bfa0.topMargin + 15>",
"<NSLayoutConstraint:0x7ff1c24a3360 UIImageView:0x7ff1c277c070.centerY == UITableViewCellContentView:0x7ff1c277bfa0.centerY>",
"<NSLayoutConstraint:0x7ff1c24b7010 'UIView-Encapsulated-Layout-Height' V:[UITableViewCellContentView:0x7ff1c277bfa0(43.5)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7ff1c24a3360 UIImageView:0x7ff1c277c070.centerY == UITableViewCellContentView:0x7ff1c277bfa0.centerY>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2015-01-06 11:35:58.646 FitLift[4174:130902] 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:0x7ff1c24c4390 UIImageView:0x7ff1c24bc880.top == UITableViewCellContentView:0x7ff1c24bc3d0.topMargin + 15>",
"<NSLayoutConstraint:0x7ff1c24c43e0 UIImageView:0x7ff1c24bc880.centerY == UITableViewCellContentView:0x7ff1c24bc3d0.centerY>",
"<NSLayoutConstraint:0x7ff1c24c7880 'UIView-Encapsulated-Layout-Height' V:[UITableViewCellContentView:0x7ff1c24bc3d0(43.5)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7ff1c24c43e0 UIImageView:0x7ff1c24bc880.centerY == UITableViewCellContentView:0x7ff1c24bc3d0.centerY>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
From the error log, it seems the two conflicting constraints are the image view's top constraint and centerY constraint. Choose only one--iOS is confused what value to assign to the image view's y-coordinate. Do you want the image view to be a certain distance from the top, or to be a certain distance from the superview's vertical center?
As a general rule, if you want your UI to look the way you want to, DO NOT let Xcode auto-add the constraints for you. Define it yourself. We can't really help you here because we don't know the other constraints that Xcode added but don't conflict.
Try lowering one of your vertical constraint priorities to 999 or less.
"<NSLayoutConstraint:0x174091d00 V:|-(10)-[UILabel:0x14562e580'This'] (Names: '|':UITableViewCellContentView:0x17418d5b0 )>",
"<NSLayoutConstraint:0x174091e40 UITableViewCellContentView:0x17418d5b0.bottomMargin >= UILabel:0x14562e580'This'.bottom + 200>",
"<NSLayoutConstraint:0x17408c940 'UIView-Encapsulated-Layout-Height' V:[UITableViewCellContentView:0x17418d5b0(43.5)]>"
I was getting this, notice the last one, encapsulated height 43.5, I'm guessing its a default height, and if your vertical constraints don't fit within that 43.5, the error is thrown. I'm still uncertain how the self sizing cells work, but lowering priorities silenced the warning. I tested a cell shorter than the 43.5 and it also silenced it.
I had a similar problem and it was fixed by setting the tableview's estimatedRowHeight. The default 43.5 wasn't enough to even cover the fixed number of points I set (e.g., my top label in the cell was 10 points from the top of the cell, the bottom label was 10 points from the bottom, and space between rows of labels, etc.)

coming the issues of auto layouts in the console

hai i am trying the auto layout concepts,here i am getting the more issues in console,can anybody tell me how to solve this
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:0x7faeb358e200 H:|-(0)-[UIImageView:0x7faeb35834b0] (Names: '|':UIView:0x7faeb35832c0 )>",
"<NSLayoutConstraint:0x7faeb358e390 UILabel:0x7faeb358a1e0'Welcome to'.leading == UIView:0x7faeb35832c0.leadingMargin + 46>",
"<NSLayoutConstraint:0x7faeb358e4d0 UIImageView:0x7faeb3585ab0.leading == UILabel:0x7faeb358a1e0'Welcome to'.leading + 28>",
"<NSLayoutConstraint:0x7faeb358e520 UIImageView:0x7faeb3585ab0.leading == UIImageView:0x7faeb35834b0.leading + 90>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7faeb358e390 UILabel:0x7faeb358a1e0'Welcome to'.leading == UIView:0x7faeb35832c0.leadingMargin + 46>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2014-12-23 16:30:57.326 Aaja[11268:148329] Unable to simultaneously satisfy constraints.
this issue is coming 10 times repeatedly
From this error you have...
|[ImageView-b0]
|-46-[Label-e0]
-(+28)-[ImageView-b0]
[Label-e0]
i.e. |-74-[ImageView-b0] //this conflicts the first one.
[ImageView-b0]
-(+90)-[ImageView-b0]
These are the different constraints shown in the error.
It looks like a bit of a mess. You have zero spacing between the image view and the super view. You then have 46 spacing between the label and the super view.
But then you try to align the left edges of the label and image view with a difference of 28.
You then have an additional problem which I don't quite understand. You are telling it the align the leading edge of the image view with itself but with a difference. This will never be able to work.
It is basically telling you that it can't make all of the constraints work because they conflict each other and so it has to break some of them.

Unable to simultaneously satisfy constraints on opening camera

I have a app which use a webview to show some HTML forms. In HTML forms there is added functionality to choose image from device. All functionality is from HTML form for capturing image. When i click on browse button of form from webview camera opens and everything is working fine but i get below log in xcode.
Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.
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:0x16fa21f0 UIView:0x180afaa0.height == 0.454545*CAMModeDial:0x16f06760.height - 4.09091>",
"<NSLayoutConstraint:0x18065020 CAMShutterButton:0x180bfbc0.centerY == CAMBottomBar:0x16f06100.centerY>",
"<NSLayoutConstraint:0x18065b70 V:[CAMShutterButton:0x180bfbc0]-(0)-[CAMModeDial:0x16f06760]>",
"<NSLayoutConstraint:0x18065ba0 CAMModeDial:0x16f06760.bottom == UIButton:0x180b5870'Cancel'.top>",
"<NSLayoutConstraint:0x180645f0 V:[UIButton:0x180b5870'Cancel']-(31)-| (Names: '|':CAMBottomBar:0x16f06100 )>",
"<NSLayoutConstraint:0x180b6870 'UIView-Encapsulated-Layout-Height' V:[PLImagePickerCameraView:0x170f2600(0)]>",
"<NSLayoutConstraint:0x180b8780 CAMBottomBar:0x16f06100.height == PLImagePickerCameraView:0x170f2600.height>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x16fa21f0 UIView:0x180afaa0.height == 0.454545*CAMModeDial:0x16f06760.height - 4.09091>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
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:0x18065020 CAMShutterButton:0x180bfbc0.centerY == CAMBottomBar:0x16f06100.centerY>",
"<NSLayoutConstraint:0x18065b70 V:[CAMShutterButton:0x180bfbc0]-(0)-[CAMModeDial:0x16f06760]>",
"<NSLayoutConstraint:0x18065ba0 CAMModeDial:0x16f06760.bottom == UIButton:0x180b5870'Cancel'.top>",
"<NSLayoutConstraint:0x180645f0 V:[UIButton:0x180b5870'Cancel']-(31)-| (Names: '|':CAMBottomBar:0x16f06100 )>",
"<NSLayoutConstraint:0x180b6870 'UIView-Encapsulated-Layout-Height' V:[PLImagePickerCameraView:0x170f2600(0)]>",
"<NSLayoutConstraint:0x180b8780 CAMBottomBar:0x16f06100.height == PLImagePickerCameraView:0x170f2600.height>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x18065b70 V:[CAMShutterButton:0x180bfbc0]-(0)-[CAMModeDial:0x16f06760]>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
I am not able to solve it can somebody help me understand these errors and and suggest how to go about solving them?
Edit :- On searching net about CAMShutterButton,CAMModeDial,CAMBottomBar,PLImagePickerCameraView i found CAMShutterButton.h,CAMModeDial.h,CAMBottomBar.h are class files in CameraKit.framework and PLImagePickerCameraView.h is a class file in PhotoLibrary.framework. Which are part of iOS 8 private framework but i am not using any one of them in my application.
Change the priority of the constraint
"<NSLayoutConstraint:0x18065b70 V:[CAMShutterButton:0x180bfbc0]-(0)-[CAMModeDial:0x16f06760]>" from Required(1000) to High(750)

What is "UIView-Encapsulated-Layout-*" constraints? How to get rid of them?

Layout error appeared while trying to get the landscape orientation. And layout becomes broken.
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:0x78fc49c0 H:[UILayoutContainerView:0x78e536e0(320)]>",
"<NSLayoutConstraint:0x799cf0e0 'UIView-Encapsulated-Layout-Width' H:[UILayoutContainerView:0x78e536e0(568)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x799cf0e0 'UIView-Encapsulated-Layout-Width' H:[UILayoutContainerView:0x78e536e0(568)]>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
And there is the similar error for vertical constraints.
I did not create those constraints. There are no UITabBar objects. I do not know which other objects create such constraints.

Resources