Re: Today is messed up
Re: Today is messed up
- Subject: Re: Today is messed up
- From: Jonathan Hendry <email@hidden>
- Date: Sun, 10 Aug 2003 15:02:10 -0400
On Sunday, August 10, 2003, at 08:46 AM, Peter Fischer wrote:
Wesley -
In this example, you should never send today a release message
because of the way that you are creating the today variable. Sending
NSCalendarDate the calendarDate message returns a fully allocated &
initialized NSCalendarDate* object.
I think you're missing the crucial part, which is that [NSCalendarDate
date] returns an
_autoreleased_ instance, not just a "fully allocated & initialized"
instance. The
important part is that it's already autoreleased.
Which is why it's going to go away without Wesley having to do
anything, and
why he shouldn't call release on it.
- JH
_______________________________________________
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.