• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: nil properties in Fetch Requests
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nil properties in Fetch Requests


  • Subject: Re: nil properties in Fetch Requests
  • From: Charilaos Skiadas <email@hidden>
  • Date: Mon, 11 Jul 2005 12:02:23 -0500


On Jul 11, 2005, at 8:33 AM, Óscar Morales Vivó wrote:

I have a fetch request like the following:

isMale == 1 AND dateOfBirth < $CALLERBIRTHDAY AND dateOfDeath >= $CALLERBIRTHDAY

How about if you change this to:

What is the behavior you want when dateOfBirth is nil?
In my case, I have a BOOLEAN attribute isLetter, and
isLetter == YES
does not return instances where isLetter is not set. So instead of that, I used
isLetter != NO
which returns instances where isLetter is not set, as well as instances where it is equal to YES.
Maybe this will also apply to your case, appropriately modified?


Where isMale is a non-optional boolean property, and both dateOfBirth and dateOfDeath are optional date properties.

I know I cannot instantiate $CALLERBIRTHDAY with nil. In those cases where I find it, I can substitute it for [NSDate distantPast] and [NSDate distantFuture] as appropriate.

However I don't know how and if the predicate will work if dateOfBirth and/or dateOfDeath haven't been set for any of the entities that go through it. Depending on the behavior I'll have to pretty much forget about using fetch requests for my needs and go through code, which kind of defeats the purpose of the fetch requests in the first place.


Haris


_______________________________________________ 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
References: 
 >[FOLLOWUP] nil properties in Fetch Requests, part 2 (From: Óscar Morales Vivó <email@hidden>)
 >nil properties in Fetch Requests (From: Óscar Morales Vivó <email@hidden>)

  • Prev by Date: Re: Inserting Special Characters into a String
  • Next by Date: Re: NSColor to color name/NSString:
  • Previous by thread: nil properties in Fetch Requests
  • Next by thread: Re: nil properties in Fetch Requests
  • Index(es):
    • Date
    • Thread