Coredata - “NSObjectInaccessibleException - CoreData could not fulfill a fault”

前端 未结 4 682
无人及你
无人及你 2021-01-30 21:39

I am new to Core data and still figuring out the nuts and bolts and this error has been bugging me for hours and I cant seem to find a solution. Any help is greatly appreciated.

4条回答
  •  梦毁少年i
    2021-01-30 22:37

    Your over releasing fetchedObjects in your readFromCoreData method. executeFetchRequest will return to you autoreleased objects anyway. When the current run loop finished executing (when you're jumping from views) then it attempt to release the objects twice (assuming you haven't used your own autorelease pools).

    I'd change

    return [fetchedObjects autorelease]; 
    

    to

    return fetchedObjects;
    

提交回复
热议问题