ios - Application crashes on launch due to Core Data fault -


a tester has run situation in (ios) app crashes on launch due core data fault not fulfilled (an nsobjectinaccessibleexception thrown). because first thing application populate table view managed objects, application continues crash on launch.

the question simple. how can solve problem tester can @ least continue using application without loss of data?

to provide bit more context question, application crashes when table view cells configured shown below. method invoked tableview:cellforrowatindexpath:.

- (void)configurecell:(uitableviewcell *)cell atindexpath:(nsindexpath *)indexpath {     // fetch store     ccdstore *store = [self.fetchedresultscontroller objectatindexpath:indexpath];      // configure cell     [cell.textlabel settext:[store name]]; // exception thrown due core data fault     [cell.detailtextlabel settext:[store numberoflists]]; } 

because don't have access device or (sqlite) database, guess part of database contains corrupt data resulting in fault.

when see faults in app, happens due releasing nsmanagedobjectcontext. when nsmanagedobject "taken" context, , context released, object fires fault in order free memory. maybe checking if context exists can tell if that's problem. if is, sure retain correct way (if use arc, declare context in interface file of class.


Comments