Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect?

2016-08-24 Thread Jeff Szuhay
> On Aug 24, 2016, at 8:02 PM, Britt Durbrow > wrote: > > >> On Aug 24, 2016, at 12:59 PM, Jeff Szuhay wrote: >> >> I draw my images (clocks) into a “reference” sized rectangle—for simplified >> position calculations—and then have

Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect?

2016-08-24 Thread Britt Durbrow
> On Aug 24, 2016, at 12:59 PM, Jeff Szuhay wrote: > > I draw my images (clocks) into a “reference” sized rectangle—for simplified > position calculations—and then have CoreGraphics scale into the destination > view rect. Don’t do that with bitmap scaling. It’s wasteful, and

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: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect?

2016-08-24 Thread Jeff Szuhay
> On Aug 24, 2016, at 12:59 PM, Jeff Szuhay wrote: > > >> On Aug 24, 2016, at 10:37 AM, Jean-Daniel Dupas > > wrote: >> >>> Moreover, the performance will greatly depends the sampling algorithm you >>> choose. CGImage

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

Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect?

2016-08-24 Thread Jeff Szuhay
> On Aug 24, 2016, at 10:37 AM, Jean-Daniel Dupas wrote: > >> Moreover, the performance will greatly depends the sampling algorithm you >> choose. CGImage provide a couple of algorithms with different tradeoff (see >> CGContextSetInterpolationQuality() and NSImage and

Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect?

2016-08-24 Thread Jean-Daniel Dupas
> Le 24 août 2016 à 19:33, Jean-Daniel Dupas a écrit : > >> >> Le 24 août 2016 à 18:50, David Duncan a écrit : >> >> >>> On Aug 24, 2016, at 1:23 AM, Jeff Szuhay wrote: >>> >>> I’m using a bunch of layers to draw images to,

Re: NSAlert::runModal doesn't work on 10.6

2016-08-24 Thread corbin dunn
> On Aug 23, 2016, at 4:31 PM, dangerwillrobinsondan...@gmail.com wrote: > > > >> On Aug 24, 2016, at 2:56 AM, Andreas Falkenhahn >> wrote: >> >> Is that your personal opinion or is this documented anywhere? > There's not anything to the contrary I've seen. Andreas

Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect?

2016-08-24 Thread Jean-Daniel Dupas
> Le 24 août 2016 à 18:50, David Duncan a écrit : > > >> On Aug 24, 2016, at 1:23 AM, Jeff Szuhay wrote: >> >> I’m using a bunch of layers to draw images to, compose them, and then draw >> into a viewRect >> with >> >>

Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect?

2016-08-24 Thread David Duncan
> On Aug 24, 2016, at 1:23 AM, Jeff Szuhay wrote: > > I’m using a bunch of layers to draw images to, compose them, and then draw > into a viewRect > with > > CGContextDrawLayerInRect( viewContext, viewRect, myLayer); > > Of course, I’m trying to pick the most

Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect?

2016-08-24 Thread Jeff Szuhay
I’m using a bunch of layers to draw images to, compose them, and then draw into a viewRect with CGContextDrawLayerInRect( viewContext, viewRect, myLayer); Of course, I’m trying to pick the most reasonable size for my layers. I currently use 1024x1024 but could easily make them 512x512