NSArrayController fetchPredicate behaving badly
NSArrayController fetchPredicate behaving badly
- Subject: NSArrayController fetchPredicate behaving badly
- From: Jamie Hardt <email@hidden>
- Date: Thu, 11 Sep 2008 09:29:55 -0700
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/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden