Core Data app crashing with “controllerWillChangeContent : unrecognized selector sent to instance”

后端 未结 2 1407
北荒
北荒 2021-01-02 18:53

I\'ve got a core data app with 2 views. The first view lists \"Rooms\", the second lists \"Scenes\" in rooms. The Rooms page has an edit NavItem button, which when pressed e

相关标签:
2条回答
  • 2021-01-02 19:34

    Even I faced the same issue. But for iOS 4.2 the problem is NSError is initialized, so it is treated as garbage and while updating/inserting we have

    if (![managedObjectContext save:&error]) {
            NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
            exit(-1);
        }
    

    So in save the iOS treats the error as garbage and so the exception. Try to initialize it to nil. It solved my problem. The issue is seen only with 4.2iOS.

    0 讨论(0)
  • 2021-01-02 19:51

    That error is most likely coming from a NSFetchedResultsController that has a released delegate. Do you have a UIViewController that you released and didn't release the associated NSFetchedResultsController?

    0 讨论(0)
提交回复
热议问题