I have a custom cell,the tableview is works when I do not use this method:
self.tableView.registerClass(goodsCell.self, forCellReuseIdentifier: "gCell");
but after that I use the method as above, something wrong happen.
All UIView
in Custom Cell like UILabel
... etc become nil so I can't use it.
My custom cell is in StoryBoard
can anyone tell me how to fix it?
EDIT:
I really ask stupid quz... I go to b ViewController by this code:
var page = BViewController();
self.presentViewController(page, animated: true, completion: nil);
Actually... this page view is empty..because it's view is created by storyboard. So, I change my code like this:
var page = self.storyboard?.instantiateViewControllerWithIdentifier("bViewController") as bViewController;
self.presentViewController(page, animated: true, completion: nil);
this code will get view from storyboard, then your view not empty anymore. but it have to set the ViewController's idnetifier in the storyboard, or you will get error msg.
hope someone like me before will see this.
now I found the answer by myself, because I did not really loaded the layout I use this method go to another page:
self.navigationController?.pushViewController(next, animated: true);
then, this way let me didn't loaded the ViewController. so I can't find the cell is normal.
finnally I use the Code below to fix ViewController didn't loaded:
var next = self.storyboard.instantiateViewControllerWithIdentifier("view1") as page;
self.navigationController?.pushViewController(next, animated: true);
I don't know this way is good or bad, but it work.