Core Data fetch performance, design pattern sought
Core Data fetch performance, design pattern sought
- Subject: Core Data fetch performance, design pattern sought
- From: "Sean McBride" <email@hidden>
- Date: Thu, 2 Sep 2010 17:46:11 -0400
- Organization: Rogue Research Inc.
Hi all,
I have 2 CoreData entities, Foo and Bar. Both have 'name' string
attributes. There are textfields allowing the user to rename any Foo
and any Bar. Assume no 2 Foos can have the same name; likewise for
Bars. There is a relationship between Foo and Bar. I want a Foo to be
related to a Bar if and only if their names match. That is, when the
user renames a Foo (or a Bar), I want to add/break a relationship
between the Bar (or Foo) of the same name.
Up to now I've done this by implementing Foo's setName: to 1) change
self's name and 2) fetch Bars of the same name. Likewise for Bar. This
works. But it's slow if a single user action changes many names at once
because many redundant fetches are performed.
Any suggestions on a good pattern to solve this?
Thanks,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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