• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Does setFormatter() retain?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Does setFormatter() retain? (From: Andreas Falkenhahn <email@hidden>)
 >Re: Does setFormatter() retain? (From: Ben Kennedy <email@hidden>)
 >Re: Does setFormatter() retain? (From: Andreas Falkenhahn <email@hidden>)

  • Prev by Date: Re: Does setFormatter() retain?
  • Next by Date: Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect?
  • Previous by thread: Re: Does setFormatter() retain?
  • Next by thread: Re: Does setFormatter() retain?
  • Index(es):
    • Date
    • Thread