我有一個自定義單元格中,實現代碼如下是當我不使用此方法的工作原理:的UIView在CustomCell將爲零後,我的RegisterClass
self.tableView.registerClass(goodsCell.self, forCellReuseIdentifier: "gCell");
但在那之後我用,上述方法,一些錯誤發生。
全部UIView
在自定義單元格中像UILabel
...等變成零,所以我不能使用它。
我的自定義單元格是在StoryBoard
誰能告訴我如何解決它?
編輯:
我真的問傻QUZ ... 我去了這個代碼到B的ViewController:
var page = BViewController();
self.presentViewController(page, animated: true, completion: nil);
其實...查看此頁面是empty..because它的視圖是由故事板創建的。 所以,我改變了這樣的代碼:
var page = self.storyboard?.instantiateViewControllerWithIdentifier("bViewController") as bViewController;
self.presentViewController(page, animated: true, completion: nil);
這個代碼將故事板視圖得到,那麼你的觀點不是空的了。 但它必須在故事板中設置ViewController的idnetifier,否則會得到錯誤消息。
希望以前像我這樣的人會看到這個。
此代碼位於Swift中,在字符串之前不再有'@' – Alfonso 2014-09-24 12:01:21
這些標籤只是ios和自定義單元格。我的錯 – latenitecoder 2014-09-24 14:14:41