0

Not sure whether title is correct or not, I'm calling newViewController on button click but it is not rendering that. as it was working fine in Xcode 6.4 but in Xcode 7 its hangs the UI and not showing new view controller after pushViewController.

this is the error logs which print on console

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:0x16bbe0c0 V:[UIView:0x157fb230(45)]>",
"<NSLayoutConstraint:0x16bbc390 V:[UIView:0x157fb230(0)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x16bbe0c0 V:[UIView:0x157fb230(45)]>

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 add break point in viewDidLoad of next controller it is calling that but not loading that ViewController.

EDIT

I seen that CPU usage are at 100% and second thing that my Viewcontroller have tableView so when i debug then it call my CellForRowatIndexPath for all the rows, so not sure where it exactly getting freezed my ViewController.

UPDATE

I'm updating my question again, I removed that error constrains (i.e. 45 and 0) now I'm not getting any constrains warning or error on console but still my UIView is freezes. Please help Thanks

Rahul Shirphule
  • 989
  • 3
  • 14
  • 36
  • 1
    It looks as if the view may be loading but setting the width to 0, so you can't see it (you probably see a black space instead). This suggests you have to check your layout constraints to resolve the conflict. – foundry Sep 24 '15 at 15:46
  • 1
    You have a constraint with a 45 value and another one doing the same with a value of 0. The debugger says that it would ignore the one with 45 value. So the one with 0 value is kept, which can explain what you don't show a thing. – Larme Sep 24 '15 at 15:47
  • thanks foundry & Larme but why it is not running , because as it is working fine on Xcode 6.4 (just giving warning ). and second thing why apple gives the memory of the view why not they give name of the view instead (this might not be the question but yes I'm frustrated ) why not apple keep it simple like android XML view just like that – Rahul Shirphule Sep 24 '15 at 15:51
  • pleaseshow your constraints!!! – Teja Nandamuri Sep 24 '15 at 16:02
  • @Mr.T actually I'm confuse which constrains exactly should i show to you, because it have tableview and multiple tableCell so... – Rahul Shirphule Sep 24 '15 at 16:27
  • show the constraints of your view controller. Im sure you are using uiview controller with a table veiw – Teja Nandamuri Sep 24 '15 at 16:37
  • can you log size of your view in viewDidLoad? – Misha Sep 25 '15 at 05:32
  • @Misha the views frame are : {{0, 0}, {375, 667}} on iphone 6 simulator ios9 – Rahul Shirphule Sep 25 '15 at 09:35
  • @Mr.T I have update the question with tableview constrains do u need constrains for the each table too? – Rahul Shirphule Sep 25 '15 at 09:56

2 Answers2

0

It seems like you have two conflicting height constraints in one of your views. One is telling your view to have 0 height, the other tells it to have 45.

Also not related to the error message: You do not need the "Align center X to Superview" constraint, as that will be implicit because of leading/trailing constraints.

EDIT:

Try the implementing the following initializer and instantiate it with [MyViewControllerClass new]. I have had trouble previously with the default behavior of the viewcontroller loading a nib with the same name as the view controller by default. This is of course assuming you're not using a storyboard, in which case I can't really help.

- (instancetype)init 
{
   self = [super initWithNibName:@"MyNibName" bundle:nil]
   if (self)
   {
   }

   return self
}
Nailer
  • 2,446
  • 1
  • 24
  • 34
  • Hi @Nailer thanks, I remove that error constrains but still view hangs and CPU usage is 100%. I update my question please take look..! because as I earlier said it was working fine with Xcode 6.4 – Rahul Shirphule Sep 28 '15 at 10:27
  • I've had some troubles when not using the initWithNibName:bundle: initializer with an explicit nib name. If your app is missing that, try adding it. – Nailer Sep 29 '15 at 15:28
0

I had this problem as well and it had to do with placeholder text (I am using storyboard). Clear out any placeholder text you have in fields and see if it works! Mine does. If that helps, just set the placeholder text in code as opposed to storyboard. I answered a similar question here:

Instantiating Modal view controller freezes the app - Probable issue with Xcode 7

Community
  • 1
  • 1
CodeNoob
  • 250
  • 3
  • 9