Re: Core Data and +[NSExpression expressionForFunction:...]
Re: Core Data and +[NSExpression expressionForFunction:...]
- Subject: Re: Core Data and +[NSExpression expressionForFunction:...]
- From: Jerry Krinock <email@hidden>
- Date: Fri, 27 Nov 2009 17:54:00 -0800
On 2009 Nov 27, at 12:23, Ron Aldrich wrote:
> but I'd very much like to understand why this isn't working.
>
> On Nov 25, 2009, at 11:34 PM, Alexander Spohr wrote:
>
>> I am not sure if that works at all. I never fetched using methods that are not part of the database as a qualifier.
The reason hypothesized by Alexander is indeed the reason. Core Data fetch predicates won't even work with ^transient^ properties. Your -distanceFromLatitude is even less than transient -- it's derived. In my experience, fetching with such a predicate will fail silently.
These limitations are implied, actually somewhat understated, in the following document which describes the "features" of the various store types:
http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/CoreData/Articles/cdPersistentStores.html#//apple_ref/doc/uid/TP40002875
If you read between the lines in the section "Fetch Predicates and Sort Descriptors", you'll conclude that what you're doing is not going to work.
Hey, be thankful that did you didn't test with the XML store and plan to "flip the switch" to the sqlite store on shipping day. You would have been very disappointed :))
_______________________________________________
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