Closed franzhcs closed 10 years ago
Having a similar problem, but I am not running the beta, so I suspect it is unrelated to that for you. I'm now using your suggestion of resetting the context when I'm re-populating my NSFetchedResultsController, and now getting my desired behavior, so thanks - agree, not a pretty work-around, but it will do until a fix comes to MR.
There is also sort of discussion here: http://stackoverflow.com/questions/11212702/nspredicate-not-executed/11407413#11407413
Resetting the context introduced other problems for me that I didn't notice at first. The latest code in combination with the fix linked to below and things seem to be working the way I want them to now if I call:
[[NSManagedObjectContext MR_defaultContext] MR_saveNestedContexts];
in the Completion block.
https://github.com/clinseman/MagicalRecord/commit/8c777c1d01e9550e19ea284206b9658a97ea3cf3#-P0
Given the age of this issue, and the volume of issues we have to work through, I've decided to close this alongside a number of other older issues.
If you can still replicate the issue under the latest in-development version of MagicalRecord (3.0 at the time of writing), please feel free to re-open and one of @magicalpanda/team-magicalrecord will take another look. Thanks!
This is not an issue but it's rather a question. Since I don't know whether this is a MagicaRecord bug, iOS bug, Core Data bug or me making mistakes (this is sure) I would like to ask here since you know things better.
This happened after installing the latest iOS version (the beta one) and I don't know whether it worked correctly on the previous version.
This is the workflow:
What happens:
A small ugly workaround I found is to issue
[[NSManagedObjectContext MR_defaultContext] reset]
right before opening the VC (therefore fetching the objects from the main thread).More specifically:
Company
andFamily
are twoNSManagedObject
.and its content:
Notice the two Family objects. Next I want to retrieve all the Family objects tied with such Company:
What happens is the following:
first
is an empty arraysecond
contains the two Family objects (correct)third
is an empty arrayAccording to what the Apple documentation states (the Joins paragraph), it is strongly suggested to use the way I used in the
first
experiment but it won't work. Still, if I close and reopen the application, all the three statements give the same result: an array with two entries.Can someone shed a light on this? Thank you so much and sorry for the long post.