tableview to other view autoresize issue : swift

2.4k views Asked by At

When I press a cell on my tableview it shows an other view where i have an image, some labels and a banner. But in the console appears this message:

 <UIView: 0x7f9f31495480; frame = (0 0; 375 667);
 autoresize = W+H; layer =  <CALayer: 0x7f9f31495590>>'s window is not equal to 
 <Project.AfterTableViewController: 0x7f9f316eb9b0>'s view's window!

The app works fine on device and simulator too, and there is no code errors, but still appears this on the console in Xcode 6. How can I fix that?

2

There are 2 answers

0
Tushar On

It can be an issue with multiple segue being fired when you tap the cell e.g in interface builder you have created a segue from cell to another view controller and also from code you are calling performSegue: from didSelectCellAtIndexpath:

you need just one segue not two. Check whether this is the issue.

0
Ganesan Arunachalam On

I also got the same issues,this occurs due to presenting viewController from another ViewController.

Initial Code: let vc = DetailViewController() presentViewController(vc, animated: true, completion: nil)

Modified Code: let vc :DetailViewController = segue.destinationViewController as! DetailViewController

While performing Segue action , you have to use destinationViewController for presenting ViewController.

This code works fine for me.

Thanks & Regards, Ganesan.A