• 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: CoreData Date Problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData Date Problems


  • Subject: Re: CoreData Date Problems
  • From: John Timmer <email@hidden>
  • Date: Wed, 27 Jul 2005 07:57:39 -0400

This is one of the relatively minor annoyances of CoreData - things that
come through the valueForKey or bindings are typically not the calendar
dates you define in your object model.  To compensate for that, I typically
use the following line of code:

tmpDate = [NSCalendarDate dateWithTimeIntervalSince1970: [[entry
valueForKey: @"theDate"] timeIntervalSince1970]];


> I have an attribute that is of type date.
>
> I am trying to use the following code to convert the date into a
> NSCalendarDate from the results of a NSFetchRequest:
>
> NSManagedObject* aTask = [results ObjectAtIndex:loop];
>
> NSCalendarDate* thisDate = [aTask valueForKey:@"dueDate"];
>
> NSLog([thisDate descriptionWithCalendarFormat:@"%a %m/%d/%y %I:%M %p"]);
>
> When I try to use the thisDate object I get the following error:
>
> -[NSCFDate descriptionWithCalendarFormat:]: selector not recognized
> [self = 0x502ff90]
>
> String values can be extracted from the attribute without any problems.
>
> The entry in the XML for it looks like this:
>
> <attribute name="duedate" type="date">144111600.00000000000000000000</
> attribute>
>
> Any ideas?
>
_______________________________________________
This mind intentionally left blank


 _______________________________________________
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: 
 >CoreData Date Problems (From: Andrew Sage <email@hidden>)

  • Prev by Date: CoreData Date Problems
  • Next by Date: Re: Running out of memory with Core Data
  • Previous by thread: CoreData Date Problems
  • Next by thread: Text System Bugs
  • Index(es):
    • Date
    • Thread