Re: Does setFormatter() retain?

2016-09-02 Thread Dave
> On 29 Aug 2016, at 03:26, Andy Lee wrote: > > On Aug 24, 2016, at 4:25 PM, Jens Alfke wrote: >> >>> On Aug 24, 2016, at 1:04 PM, Andreas Falkenhahn >>> wrote: >>> >>> Now, will "setFormatter" call retain on "formatter" or not?

Re: Does setFormatter() retain?

2016-08-28 Thread Andy Lee
On Aug 24, 2016, at 4:25 PM, Jens Alfke wrote: > >> On Aug 24, 2016, at 1:04 PM, Andreas Falkenhahn >> wrote: >> >> Now, will "setFormatter" call retain on "formatter" or not? Looking >> at "retainCount" seems to suggest so, although I know that

Re: Does setFormatter() retain?

2016-08-24 Thread Graham Cox
> On 25 Aug 2016, at 6:24 AM, Andreas Falkenhahn 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

Re: Does setFormatter() retain?

2016-08-24 Thread Doug Hill
Also, if you're unsure whether you're following ref-counting rules correctly, the static analyzer in Xcode will give very detailed warnings about incorrect uses. Just another way to determine if you're using ref-counting correctly. Doug Hill > On Aug 24, 2016, at 2:49 PM, Doug Hill

Re: Does setFormatter() retain?

2016-08-24 Thread Doug Hill
Wim, If I may paraphrase: The reference counting semantics are only interesting to the caller when the callee returns an object. What the callee does with a setter is entirely the responsibility of the callee to make sure it follows ref-counting rules. For example, a setter may not involve a

Re: Does setFormatter() retain?

2016-08-24 Thread Quincey Morris
On Aug 24, 2016, at 13:37 , Andreas Falkenhahn wrote: > > Thanks, this would make "setFormatter" a case of strong reference because > it isn't documented otherwise... To expand on what Jens said, slightly… You’d need to check the docs for the version of the SDK you’re

Re: Does setFormatter() retain?

2016-08-24 Thread Wim Lewis
On Aug 24, 2016, at 1:04 PM, Andreas Falkenhahn wrote: > I have read Apple's memory management guide on retain/release and > I think I've basically got it, but there's just one thing that > I'm not confident about and that is "setXXX" methods which accept an > NSObject

Re: Does setFormatter() retain?

2016-08-24 Thread Ben Kennedy
> On 24 Aug 2016, at 1:24 pm, Andreas Falkenhahn 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

Re: Does setFormatter() retain?

2016-08-24 Thread Andreas Falkenhahn
On 24.08.2016 at 22:25 Jens Alfke wrote: > On Aug 24, 2016, at 1:04 PM, Andreas Falkenhahn > wrote: > Now, will "setFormatter" call retain on "formatter" or not? Looking > at "retainCount" seems to suggest so, although I know that this > isn't reliable and shouldn't

Re: Does setFormatter() retain?

2016-08-24 Thread Jens Alfke
> On Aug 24, 2016, at 1:04 PM, Andreas Falkenhahn > wrote: > > Now, will "setFormatter" call retain on "formatter" or not? Looking > at "retainCount" seems to suggest so, although I know that this > isn't reliable and shouldn't be done at all... These days, with ARC,

Re: Does setFormatter() retain?

2016-08-24 Thread Andreas Falkenhahn
On 24.08.2016 at 22:14 Ben Kennedy wrote: >> On 24 Aug 2016, at 1:04 pm, Andreas Falkenhahn >> wrote: >> I have read Apple's memory management guide on retain/release and >> I think I've basically got it, but there's just one thing that >> I'm not confident about and

Re: Does setFormatter() retain?

2016-08-24 Thread Ben Kennedy
> On 24 Aug 2016, at 1:04 pm, Andreas Falkenhahn wrote: > > I have read Apple's memory management guide on retain/release and > I think I've basically got it, but there's just one thing that > I'm not confident about and that is "setXXX" methods which accept an >

Does setFormatter() retain?

2016-08-24 Thread Andreas Falkenhahn
I have read Apple's memory management guide on retain/release and I think I've basically got it, but there's just one thing that I'm not confident about and that is "setXXX" methods which accept an NSObject parameter and I don't know how I can know whether the "setXXX" retains or not. For