Re: Core Data and +[NSExpression expressionForFunction:...]
Re: Core Data and +[NSExpression expressionForFunction:...]
- Subject: Re: Core Data and +[NSExpression expressionForFunction:...]
- From: Ron Aldrich <email@hidden>
- Date: Sun, 29 Nov 2009 23:55:10 -0800
I'm left wondering "Under what circumstances would +[NSExpression expressionForFunction:selectorName:arguments:] be useful.
An example would be helpful, but I sure wasn't able to find one.
Meanwhile, I switched to a simple bounds check, which works just fine.
Thanks for your time.
- Ron
On Nov 27, 2009, at 5:54 PM, Jerry Krinock wrote:
>
> 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
_______________________________________________
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