Re: fetch request with compound predicate doesn't sort properly
Re: fetch request with compound predicate doesn't sort properly
- Subject: Re: fetch request with compound predicate doesn't sort properly
- From: Ken Victor <email@hidden>
- Date: Tue, 14 Mar 2006 16:00:43 -0800
At 3:51 PM -0800 3/14/06, Greg Herlihy wrote:
Is there a reason for making a copy of the NSFetchRequest? And have
you tested without making this copy:
NSFetchRequest* request = [objectModel fetchRequestTemplateForName: fn];
the same problem exists whether or not i make the copy. i make the
copy because i use the same fetch request with different sort
descriptors at various parts of my app. i discovered empiracally that
setting the sort descriptors on a request retrieved from the model
"stuck" with the request the next time i retreived it from the model.
i didn't quite understand why this was so, but figured the easiest
solution was simply to use a copy and then "attach" the appropriate
sort descriptors as needed.
ken
Greg
On 3/14/06 3:30 PM, "Ken Victor" <email@hidden> wrote:
> NSFetchRequest* request = [[[objectModel
fetchRequestTemplateForName: fn] copy] autorelease];
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden