Re: There's obviously something I don't understand about NSDate.
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