CoreData: error: Serious application error. An exception was caught from the delegate of NSFetchedResultsController during a call to -controllerDidChangeContent:

看看xcode的具体的描述:

CoreData: error: Serious application error. An exception was caught from the delegate of NSFetchedResultsController during a call to -controllerDidChangeContent:. UITableView internal bug: unable to generate a new section map with old section count: 1 and new section count: 0 with userInfo (null)

下面看下的我的关键代码:

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
   
    if (self.serviceItems.count > 0) {
        return 1;
    } else {
        return 0;
    }

}

以上代码当数据源数组大于0的时候section返回1,否则返回0.看似没问题,一开始我的self.serviceItems.count > 0,但是self.serviceItems是可变的,当self.serviceItems变化的时候我会刷新数据源(tableView.reloadData)。所以我进行删除操作的时候self.serviceItems.count可能会等于0,当self.serviceItems.count等于0的时候就数据源方法就返回0了,UITableView internal bug: unable to generate a new section map with old section count: 1 and new section count: 0 with userInfo (null),意思是无法用新生成的section=0替换原来的section=1,这是UITableView本身是bug(UITableView internal bug:...)所以改下代码,变为

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

return 1;

}

始终返回1即可。

时间: 2024-12-28 06:30:32

CoreData: error: Serious application error. An exception was caught from the delegate of NSFetchedResultsController during a call to -controllerDidChangeContent:的相关文章

Server Error in '/' Application

1, Server Error in '/' Application. Access to the path '636081729995142753' is denied. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error an

一个iframe注入漏洞,也是微软的 Application["error"] 漏洞

最近学校进行安全等级评估,有人给我打电话,说我之前写的一个网站存在iframe注入漏洞,页面是error页面.我于是用netsparker扫描了自己的网站,果然发现error页面存在漏洞,我写网站的时候,为了方便知道当前程序错误,写了一个error页面,代码如下 if (!IsPostBack) { div_error.InnerHtml = Application["error"].ToString() + "<br/>" + "<a

SpringMVC常见问题Error configuring application listener of class org.springframework.web.context.ContextLoaderListenejava.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

六月 20, 2018 9:43:34 下午 org.apache.catalina.core.StandardContext listenerStart 严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException: org.springframework.web.context.

Java出现“Error configuring application listener of class...”类似的错误解决

错误如下: Error configuring application listener of class com.jsoft.jblog.listener.SessionListener java.lang.ClassNotFoundException: com.jsoft.jblog.listener.SessionListener at org.apache.catalina.loader.WebappClassLoaderBase.loadClass 解决方法: 1.可能是servelt

Ionic App 启动时报Application Error - The connection to the server was unsuccessful

最近在更新App的时候,发现在华为手机上报这个错误,有点困惑,查找资料分析,大概原因是程序在加载index.html网页时,加载的资源过多,造成时间超时, 这个时原因分析https://stackoverflow.com/questions/12319809/application-error-the-connection-to-the-server-was-unsuccessful-file-andr 具体的解决方案是在config.xml文件中添加如下延时设置: <!--解决程序启动问题:A

Server Error in &#39;/&#39; Application. Could not load file or assembly &#39;IBM.Data65

baozoumanhua.com/users/17157008/followingsbaozoumanhua.com/users/17157008/talkingsbaozoumanhua.com/users/17157008/following_articlesbaozoumanhua.com/users/17157008/articlesbaozoumanhua.com/users/17157027baozoumanhua.com/users/17157027/forum_articlesb

[Android_Bug]处理PhoneGap Application Error: "The connection to the server was unsuccessful.(file:///android_asset/www/index.html)"的错误

android 在log中提示TimeOut Error后,应用程序弹出application error the connection to the server was unsuccessful 的错误的处理方法: 第一步 找到项目中res/xml目录下的config.xml,把你的外网的域名地址添加到配置中     <access origin="http://example.com" /> 第二步 在activity的onCreate方法中加入一行代码 public

java.lang.IllegalArgument,Parse error in application web.xml file at jndi:/localhost/WEB-INF/web.xml

启动Tomcat时错误:java.lang.IllegalArgumentException: Can't convert argument: nullParse error in application web.xml file at jndi:/localhost/WEB-INF/web.xml Resolution:上述问题,是由于在Eclipse下重构JEE项目名时,Eclipse自动更新了部署文件web.xml,重新生成了xml文件的头部声明,新增加了javaee的命名空间. Xml代

Server Error in &#39;/&#39; Application.Object reference not set to an instance of an object.

这个错误是数据库角色权限造成的 只选中db.owner就可以了 Server Error in '/' Application.Object reference not set to an instance of an object.,布布扣,bubuko.com Server Error in '/' Application.Object reference not set to an instance of an object.