• 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: Fetching a CalEvent with earliest startDate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fetching a CalEvent with earliest startDate


  • Subject: Re: Fetching a CalEvent with earliest startDate
  • From: Lee Gillen <email@hidden>
  • Date: Mon, 4 Feb 2008 23:50:47 -0500

Given an array of CalEvents how can I fetch a single CalEvent with the earliest startDate?

I am getting an array of CalEvents from:
NSArray *calendarEvents = [[CalCalendarStore defaultCalendarStore] eventsWithPredicate:eventsPredicate];

NSDate *minDate = [calendarEvents valueForKeyPath:@"@min.startDate"];

I don't see any method in NSPredicate or NSExpression that allows me to do an evaluation function @min on an object's date value ivar.

The solution was using simple KVC. _______________________________________________


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


References: 
 >Fetching a CalEvent with earliest startDate (From: Lee Gillen <email@hidden>)

  • Prev by Date: Re: Use of Mac OS X 10.5 / Leopards Garbage Collection Considered Harmful
  • Next by Date: Re: Conceptually understanding Core Animation
  • Previous by thread: Fetching a CalEvent with earliest startDate
  • Next by thread: need to not shift row in outline view
  • Index(es):
    • Date
    • Thread