Re: Does setFormatter() retain?
Re: Does setFormatter() retain?
- Subject: Re: Does setFormatter() retain?
- From: Graham Cox <email@hidden>
- Date: Thu, 25 Aug 2016 09:30:17 +1000
> On 25 Aug 2016, at 6:24 AM, Andreas Falkenhahn <email@hidden> wrote:
>
> If it retains, I could just do the following:
>
> [textField setFormatter:formatter];
> [formatter release];
>
> And I wouldn't have to worry about "formatter" any longer. If it doesn't retain,
> the above isn't possible.
You should do this anyway - you only need to concern yourself with YOUR memory management, not other objects’. Are you done with it? Then release it. Whether the other object retained it or not is not your business or concern. If we had to know what other objects did with every parameter passed to them programming would be impossible.
Or use ARC and let the compiler figure it out.
—Graham
_______________________________________________
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