Re: There's obviously something I don't understand about autorelease.
Re: There's obviously something I don't understand about autorelease.
- Subject: Re: There's obviously something I don't understand about autorelease.
- From: Charles Srstka <email@hidden>
- Date: Sat, 17 Mar 2012 22:23:28 -0500
On Mar 17, 2012, at 7:05 PM, G S wrote:
> On Sat, Mar 17, 2012 at 4:55 PM, Roland King <email@hidden> wrote:
>
>> Hmm - with respect - autorelease is an implementation detail. Nothing says
>> that objects created through the convenience constructors like [ NSDate
>> date ] have to be autoreleased, they just have to be valid for long enough
>> to be useful, they could be held in a cache and cleaned out by little
>> gnomes later.
>>
>
> Fair enough. Better to have said, "objects I didn't allocate.”
Or better yet, “objects you don’t own.” In addition to allocating an object, you can take ownership of an object by retaining an object that something else passes to you.
> I would've converted my project to ARC had time permitted. I will say that
> this new understanding does make me reconsider my opinion on the merits of
> properties (meaning I think they have more merit than I used to).
>
> Would it be a waste of time to go through and add properties for my members
> before converting to ARC? Does it make any difference?
It makes the code cleaner and more flexible, IMO.
Charles
_______________________________________________
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