Re: NSCalendarDate from plist
Re: NSCalendarDate from plist
- Subject: Re: NSCalendarDate from plist
- From: Kurt Revis <email@hidden>
- Date: Sun, 25 Nov 2001 21:31:15 -0800
On Sunday, November 25, 2001, at 12:36 PM, Erik M. Buck wrote:
Kurt Revis makes a very interesting observation about type casting that
is
completely unwarranted.
calDate = [NSCalendarDate dateWithTimeIntervalSinceReferenceDate:[date
timeIntervalSinceReferenceDate]];
works just fine with no compiler warning because
+dateWithTimeIntervalSinceReferenceDate returns type id
Aha! Yes, you're absolutely right--I assumed that method returned an
(NSDate *) and didn't actually check it out. That's what I get for
trying to answer questions just before going to sleep, without trying
the code in an actual compiler.
I'd still like to be using a language that could express this correctly,
though (although I'm not really a language lawyer). Using id for a
return type seems like sort of a sledgehammer approach...
--
Kurt Revis
email@hidden