How to tell ARC do not release objects in main thread, which are used in another thread?
How to prevent releasing?
-(void)someFunc
{
array = ... //fetching array of entities from a core data
for(SomeObject * obj in array)
{
NSSomeOperation * op = [[NSSomeOperation alloc] initWithValue:obj];
//start operation
}
//it seems here ARC release array and all items
}
The array is fetched from a Core Data.
I have the same problem with ARC and fetching results using FetchResultController.
I load the records first then I feed a tableView with them, it goes well at the first
but when I scroll or I select any row, the managed objects inside the array become “nil”.
The cause is: I forgot a small __strong for the object I’m creating that contains all the Core Data fetch I need.