• 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: There's obviously something I don't understand about NSDate.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: There's obviously something I don't understand about NSDate.


  • Subject: Re: There's obviously something I don't understand about NSDate.
  • From: G S <email@hidden>
  • Date: Sat, 17 Mar 2012 16:34:00 -0700

>
> I create another NSDate, on the stack, to hold "now" for use within that
> function.  Do I need to retain that too?
>
>
> Yes.
>
>
 Hm, Apple's doc says:
"Cocoa’s ownership policy specifies that received objects should typically
remain valid throughout the scope of the calling method."

This leads me to believe that the object created by [NSDate date] within
that method will remain valid throughout the method.

Thanks for the info.  I read the memory-management doc a long time ago but
apparently didn't learn everything about autorelease.  I never use it in my
own code.
_______________________________________________

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: 
 >There's obviously something I don't understand about NSDate. (From: G S <email@hidden>)
 >Re: There's obviously something I don't understand about NSDate. (From: Dave Fernandes <email@hidden>)
 >Re: There's obviously something I don't understand about NSDate. (From: G S <email@hidden>)
 >Re: There's obviously something I don't understand about NSDate. (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: There's obviously something I don't understand about NSDate.
  • Next by Date: Re: There's obviously something I don't understand about NSDate.
  • Previous by thread: Re: There's obviously something I don't understand about NSDate.
  • Next by thread: Re: There's obviously something I don't understand about NSDate.
  • Index(es):
    • Date
    • Thread