Skip navigation.
 
mlNSArrayController fetchPredicate behaving badly
FROM : Jamie Hardt
DATE : Thu Sep 11 18:29:55 2008

I'm having some difficulty with an NSArrayController that fetches a 
subset of all the entities in my NSManagedObjectContext, and I think 
it might be something simple, but I haven't been able to put my finger 
on it...

I have two entities, "Reels" and "Scenes".  Reels have many Scenes; 
reels have an "isHidden" attribute.  The array controller I'm having 
trouble with fetches scenes that are in reels that are not hidden, 
thus it's fetch predicate (in IB, and I've done this programatically) 
is "reel.isHidden == NO".

When I open a document, the ArrayController finds the correct scenes, 
the ones in unhidden reels.  If I hide one reel and show another (by 
clicking checkboxes bound to the isHidden attribute on reels, the 
array controller persists in showing the scenes for the hidden reel 
(this is the problem).  The array controller refuses to find the 
scenes in the unhidden reel no matter how many times I order it to 
fetch: or fetchWithRequest:
UNTIL I save the document, at which time the array controller realizes 
what's been going on and fetches the correct scenes.

Is my predicate right?  I can't help thinking there's something goofy 
going on in my NSManagedObjectContext, something not being committed 
or updated or something.

On a side note, does anyone know why I can't see the fetchPredicate 
for an NSArrayController in the debugger?  No such member seems to 
exist.

Thanks
Jamie Hardt
The Sound Department
http://www.soundepartment.com/
http://www.imdb.com/name/nm0362504/

Related mailsAuthorDate
mlNSArrayController fetchPredicate behaving badly Jamie Hardt Sep 11, 18:29
mlRe: NSArrayController fetchPredicate behaving badly Keary Suska Sep 11, 19:42
mlRe: NSArrayController fetchPredicate behaving badly Jamie Hardt Sep 11, 20:23