打了个全局断点,发现进入到\XMPPCoreDataStorage.h的头文件的managedObjectContext方法的实现上面 上面有错误说明

XMPP加载好友列表报错 'NSInternalInconsistencyException', reason: 'Invoked on incorrect queue'

大概是这不是安全的context在线程里面(non thread safe)

这时候发现原来在好友列表FetchedResultsController加载方法中,用错了该context

错误:NSEntityDescription *entity = [NSEntityDescription entityForName:@"XMPPUserCoreDataStorageObject.h" inManagedObjectContext:[XMPPRosterCoreDataStorage sharedInstance].managedObjectContext];

正确: NSEntityDescription *entity = [NSEntityDescription entityForName:@"XMPPUserCoreDataStorageObject.h" inManagedObjectContext:[XMPPRosterCoreDataStorage sharedInstance].mainThreadManagedObjectContext];

 

相关文章:

  • 2022-12-23
  • 2021-12-25
  • 2021-08-05
  • 2022-01-22
  • 2022-12-23
  • 2022-03-14
  • 2021-06-09
猜你喜欢
  • 2021-06-17
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案