Xcode unable to dequeue a cell with identifier

原创 2015年07月08日 10:49:32

最近在学习IOS,UITableView 的时候,在实现一个简单的tableView的时候,总是出现如下的问题:

“Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier provinceCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'”

可是明明我的Cell Identifier 已经设置为provinceCell了,设置了好几次还是出现这样的问题。

一般搜找最终在Stack Overflow上找到解决方案 感谢SO,分享给大家:

不要用下面这个系统默认的方法:

 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

试试下面的:

 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

如果还不可以,

 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

再加上下面的判断:

  if (cell == nil) {
    cell = [[customCell alloc] init];
}

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

哈02—kill error_______unable to dequeue a cell with identifier Cell

使用UITableView时经常会遇到以下错误让我们措手不及 *** Terminating app due to uncaught exception 'NSInternalInconsist...

unable to dequeue a cell with identifier cell - must register a nib or a class for the identifier or

崩溃提示: 'unable to dequeue a cell with identifier cell - must register a nib or a class for the ident...

hive日志位置(日志定位报错:Failed with exception Unable to move sourcehdfs://namenode/tmp/hive-pmp_bi/h)

Hive中的日志分为两种1. 系统日志,记录了hive的运行情况,错误状况。 2. Job 日志,记录了Hive 中job的执行的历史过程。 日志查看方法1,在本地运行机器上hive日志存储位置在本机...

Android Studio异常:Manifest merger failed with multip/Unable to start the daemon process

Manifest merger failed with multip/Unable to start the daemon process/app:transformClassesWithJarMer...

IntelliJ IDEA中Push failed: Failed with error: unable to access xx:Unknown SSL protocol error in

Push failed: Failed with error: unable to access 'https://github.com/cmshome/HelloWorld.git/': Unkno...

Unable to negotiate with legacyhost: no matching key exchange method found.

OpenSSH implements all of the cryptographic algorithms needed for compatibility with standards-compl...

vipca 经典报错 PRKH-1010 : Unable to communicate with CRS services.

Running Root.Sh On Second Node Fails PRKN-1008 Unable to load the shared library srvmhas10 [ID 34275...

Solving “javax.naming.NameNotFoundException: Unable to resolve ‘jdbc.SOAAppUserDataSource’ “ with Oracle SOA Suite 11g Adapter S

本文转载自:http://guidoschmutz.wordpress.com/2010/01/01/solving-javax-naming-namenotfoundexception-unable...

Warning: Unable to send packet: Error with PF_PACKET send() [11]: Message too long (errno = 90)

今天在使用tcpreplay重放流量时,发现有的数据包没有发送成功: Warning: Unable to send packet: Error with PF_PACKET send() [215]...

Unable to start MySQL service. Another MySQL daemon is already running with the same UNIX socket

Unable to start MySQL service. Another MySQL daemon is already running with the same UNIX socket ...
  • vicklin
  • vicklin
  • 2014年12月22日 15:56
  • 1043
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Xcode unable to dequeue a cell with identifier
举报原因:
原因补充:

(最多只允许输入30个字)