Re: Subclassing NSControl and inheritance of target, action properties
Re: Subclassing NSControl and inheritance of target, action properties
- Subject: Re: Subclassing NSControl and inheritance of target, action properties
- From: Ken Thomases <email@hidden>
- Date: Fri, 30 Jan 2015 01:11:58 -0600
On Jan 30, 2015, at 12:49 AM, Quincey Morris <email@hidden> wrote:
> On Jan 29, 2015, at 22:21 , Ken Thomases <email@hidden> wrote:
>>
>> Huh? It has to be an autorelease and not a release because the object needs to survive to the caller's scope.
>
> "Release" meant “eventual relinquishment of ownership”.
Sorry if I was overly literal.
> Since we’re talking about ARC, I wasn’t assuming that it would be an actual auto-release. In the current implementation, it might be returned retained for eventual release in the caller’s scope, I think.
Code compiled with ARC has to be compatible with code that's compiled without ARC and vice versa. A getter compiled with ARC can't assume the caller was also compiled with ARC and so it can't return it retained unconditionally. There's the funky optimization between objc_autoreleaseReturnValue() and objc_retainAutoreleasedReturnValue() which has that effect conditionally if both were compiled with ARC as detected at run time, but the general form of the generated getter code is to autorelease the value.
> Anyway, thanks for clarifying the main point.
You're welcome.
Cheers,
Ken
_______________________________________________
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: | |
| >Subclassing NSControl and inheritance of target, action properties (From: Graham Cox <email@hidden>) |
| >Re: Subclassing NSControl and inheritance of target, action properties (From: Roland King <email@hidden>) |
| >Re: Subclassing NSControl and inheritance of target, action properties (From: Graham Cox <email@hidden>) |
| >Re: Subclassing NSControl and inheritance of target, action properties (From: Quincey Morris <email@hidden>) |
| >Re: Subclassing NSControl and inheritance of target, action properties (From: Roland King <email@hidden>) |
| >Re: Subclassing NSControl and inheritance of target, action properties (From: Quincey Morris <email@hidden>) |
| >Re: Subclassing NSControl and inheritance of target, action properties (From: Greg Parker <email@hidden>) |
| >Re: Subclassing NSControl and inheritance of target, action properties (From: Quincey Morris <email@hidden>) |
| >Re: Subclassing NSControl and inheritance of target, action properties (From: Ken Thomases <email@hidden>) |
| >Re: Subclassing NSControl and inheritance of target, action properties (From: Quincey Morris <email@hidden>) |
| >Re: Subclassing NSControl and inheritance of target, action properties (From: Ken Thomases <email@hidden>) |
| >Re: Subclassing NSControl and inheritance of target, action properties (From: Quincey Morris <email@hidden>) |