• 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: NSCalendarDate from plist
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSCalendarDate from plist
      • From: "Erik M. Buck" <email@hidden>
References: 
 >Re: NSCalendarDate from plist (From: "Erik M. Buck" <email@hidden>)

  • Prev by Date: Services Menu problems
  • Next by Date: Re: Controller knowing about an event
  • Previous by thread: Re: Casting (was: NSCalendarDate from plist)
  • Next by thread: Re: NSCalendarDate from plist
  • Index(es):
    • Date
    • Thread