Re: NSCopyObject is a disaster (was Re: Another NSOutlineView issue)

2012-08-13 Thread Greg Parker
On Aug 13, 2012, at 2:12 PM, Uli Kusterer wrote: > On 09.08.2012, at 01:21, Graham Cox wrote: >> If a superclass implements copies using NSCopyObject, then any pointer ivars >> we add in a subclass need to be additionally -retained. But if the >> superclass implements copy by alloc/initing a ne

Re: NSCopyObject is a disaster (was Re: Another NSOutlineView issue)

2012-08-13 Thread Uli Kusterer
On 09.08.2012, at 02:01, Greg Parker wrote: >- (id) copyWithZone:(NSZone*) zone >{ >MyCell* copy = [super copyWithZone:zone]; >copy->someInternalPointer = [copy->someInternalPointer copy]; >return copy; >} Change this to > - (id) copyWithZone:(NSZone*) zone

Re: NSCopyObject is a disaster (was Re: Another NSOutlineView issue)

2012-08-13 Thread Uli Kusterer
On 09.08.2012, at 01:21, Graham Cox wrote: > If a superclass implements copies using NSCopyObject, then any pointer ivars > we add in a subclass need to be additionally -retained. But if the superclass > implements copy by alloc/initing a new object and setting properties, then > this extra st

Re: NSCopyObject is a disaster (was Re: Another NSOutlineView issue)

2012-08-09 Thread Jean-Daniel Dupas
Le 9 août 2012 à 02:01, Greg Parker a écrit : > On Aug 8, 2012, at 4:52 PM, Graham Cox wrote: >> I see that NSCopyObject is deprecated as of 10.8 (but is still being used >> internally). >> >> This is going to be fun moving forward :) I'm not sure how binary >> compatibility is going to be m

Re: NSCopyObject is a disaster (was Re: Another NSOutlineView issue)

2012-08-08 Thread Graham Cox
On 09/08/2012, at 9:47 AM, Quincey Morris wrote: > It seems to me that you need to think of 'copyWithZone:' as a kind of 'init…' > method, and it should therefore *not* use properties to change the instance > variables that belong to the subclass, but change them directly. This is > actually

Re: NSCopyObject is a disaster (was Re: Another NSOutlineView issue)

2012-08-08 Thread Kyle Sluder
On Wed, Aug 8, 2012, at 04:52 PM, Graham Cox wrote: > I see that NSCopyObject is deprecated as of 10.8 (but is still being used > internally). > > This is going to be fun moving forward :) I'm not sure how binary > compatibility is going to be maintained as NSCopyObject disappears, for > example,

Re: NSCopyObject is a disaster (was Re: Another NSOutlineView issue)

2012-08-08 Thread Greg Parker
On Aug 8, 2012, at 4:52 PM, Graham Cox wrote: > I see that NSCopyObject is deprecated as of 10.8 (but is still being used > internally). > > This is going to be fun moving forward :) I'm not sure how binary > compatibility is going to be maintained as NSCopyObject disappears, for > example, in

Re: NSCopyObject is a disaster (was Re: Another NSOutlineView issue)

2012-08-08 Thread Graham Cox
On 09/08/2012, at 9:39 AM, Greg Parker wrote: > NSCopyObject() is ugly. Avoid it if you can. > > NSCell uses NSCopyObject. I don't know if there are other framework classes > that are likely to be copied and subclassed that use NSCopyObject. > > One solution is to compile your subclass with

Re: NSCopyObject is a disaster (was Re: Another NSOutlineView issue)

2012-08-08 Thread Quincey Morris
On Aug 8, 2012, at 16:21 , Graham Cox wrote: > This opens up a whole big can of worms about implementing copy. > > If a superclass implements copies using NSCopyObject, then any pointer ivars > we add in a subclass need to be additionally -retained. But if the superclass > implements copy by a

Re: NSCopyObject is a disaster (was Re: Another NSOutlineView issue)

2012-08-08 Thread Greg Parker
On Aug 8, 2012, at 4:21 PM, Graham Cox wrote: > On 09/08/2012, at 9:10 AM, Graham Cox wrote: >> Ah, I'm thinking this *could* be due to my previous observation about cells >> being copied using NSCopyObject. If the cells are copied during that >> animation for some reason, then perhaps the text

NSCopyObject is a disaster (was Re: Another NSOutlineView issue)

2012-08-08 Thread Graham Cox
On 09/08/2012, at 9:10 AM, Graham Cox wrote: > Ah, I'm thinking this *could* be due to my previous observation about cells > being copied using NSCopyObject. If the cells are copied during that > animation for some reason, then perhaps the text settings for my custom cell > are not being copi

Another NSOutlineView issue

2012-08-08 Thread Graham Cox
I've just noticed another odd behaviour of NSOutlineView. This is on 10.8 and I've never noticed this before, so it might be something new. When I click a turn-down triangle to open an outline item, all of the text draws in a slightly bigger font for the duration of the triangle's animation, th