Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/119.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios [UITableView dequeueReusableCellWithIdentifier:forIndexPath:]中的断言失败_Ios_Swift_Uitableview - Fatal编程技术网

Ios [UITableView dequeueReusableCellWithIdentifier:forIndexPath:]中的断言失败

Ios [UITableView dequeueReusableCellWithIdentifier:forIndexPath:]中的断言失败,ios,swift,uitableview,Ios,Swift,Uitableview,我有一个嵌入在导航控制器中的UIViewController,它嵌入在页面视图控制器中。在我的cellForRowAtIndexPath中,我得到了2015-07-06 11:23:24.525 MyApp[3574:617281]***在-[UITableView dequeueReusableCellWithIdentifier:forIndexPath:],/SourceCache/UIKit/UIKit-3347.44.2/UITableView.m:6245 at var cell:C

我有一个嵌入在导航控制器中的UIViewController,它嵌入在页面视图控制器中。在我的cellForRowAtIndexPath中,我得到了2015-07-06 11:23:24.525 MyApp[3574:617281]***在-[UITableView dequeueReusableCellWithIdentifier:forIndexPath:],/SourceCache/UIKit/UIKit-3347.44.2/UITableView.m:6245 at var cell:CellOne=”中的断言失败

你在用故事板? 如果没有,你不是忘了注册手机吗

self.tableView.registerClass(CellOne.self, forCellReuseIdentifier: "CellOne")
self.tableView.registerClass(CellTwo.self, forCellReuseIdentifier: "CellTwo")

你可以在viewDidLoad上打这些电话,这是个安全的地方。必须在调用tableViewDataSource协议函数之前进行。

您是否检查了序列图像板中该单元格的重用标识符?检查是否有输入错误???是的,我已更正您是否正在使用Nib???不,我没有将任何nibsTry仅用于tableView.dequeueReusableCellWithIdentifier方法我正在使用序列图像板,我在你的函数中没有看到任何趋势单元格,不是吗?…因为这仍然不是答案
self.tableView.registerClass(CellOne.self, forCellReuseIdentifier: "CellOne")
self.tableView.registerClass(CellTwo.self, forCellReuseIdentifier: "CellTwo")