ios - NSFetchedResultsController crash on -controllerDidChangeContent: in iPad -


nsfetchedresultscontroller crashes on -controllerdidchangecontent: on inserting new record , saving persistentstore.

code:

- (void)controller:(nsfetchedresultscontroller *)controller    didchangeobject:(id)anobject        atindexpath:(nsindexpath *)indexpath      forchangetype:(nsfetchedresultschangetype)type       newindexpath:(nsindexpath *)newindexpath {     nslog(@"== updating indexpath (%@) newindexpath (%@) type %i", indexpath, newindexpath, (int)type);     switch (type) {         case nsfetchedresultschangedelete: {             [self.tableview deleterowsatindexpaths:@[indexpath] withrowanimation:uitableviewrowanimationtop];             break;         }         case nsfetchedresultschangeinsert: {             [self.tableview insertrowsatindexpaths:@[newindexpath] withrowanimation:uitableviewrowanimationbottom];             break;         }         case nsfetchedresultschangemove: {             [self.tableview moverowatindexpath:indexpath toindexpath:newindexpath];             break;         }         case nsfetchedresultschangeupdate: {             [self.tableview reloadrowsatindexpaths:@[indexpath] withrowanimation:uitableviewrowanimationtop];             break;         }         default:             break;     } }  - (void)controllerwillchangecontent:(nsfetchedresultscontroller *)controller {     nslog(@"== begin updating");     [self.tableview beginupdates]; }  - (void)controllerdidchangecontent:(nsfetchedresultscontroller *)controller {     nslog(@"== end updating");     [self.tableview endupdates]; } 

note:- in target application fetchedresults delegate implemented in uitableviewcontroller subclass. , fetchedresultscontroller working child managed object context.

possible sources of error (please provide error message):

  1. moc provides data frc not of nsmainqueueconcurrencytype.
  2. -controller:didchangesection:atindex:forchangetype: not implemented.

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -