Re: NSCalendarDate Questions
Re: NSCalendarDate Questions
- Subject: Re: NSCalendarDate Questions
- From: Larry Fransson <email@hidden>
- Date: Thu, 3 Jun 2004 18:49:44 -0700
On Jun 3, 2004, at 15:50, Rhon Fitzwater wrote:
Okay, so here is what I want to do:
- write to a file the current date via NSCalendarDate
- read the date written to a file and compare it against the current
date
- have the comparison return the difference in days
// Is below how I set the current date
NSCalendarDate *now = [NSCalendarDate calendarDate];
That's how you do it.
At startup, I check first to see if there is a valid serial number. If
no valid serial number, I check for existence of the invisible file
that has the first launch date in it. If it does not exist, I put the
current date into a dictionary and write the dictionary to a file. If
the file does exist, I read the dictionary from the file and compare
the date in the dictionary to today's date.
The docs for NSDictionary and NSCalendarDate contain all of the
information you need to perform the operations I just listed.
Larry Fransson
Seattle, WA
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.