Re: Found It - Problem with Outline View and Manual Memory Management
Re: Found It - Problem with Outline View and Manual Memory Management
- Subject: Re: Found It - Problem with Outline View and Manual Memory Management
- From: Graham Cox <email@hidden>
- Date: Thu, 28 May 2015 09:25:18 +1000
> On 28 May 2015, at 12:56 am, Dave <email@hidden> wrote:
>
> myCell = (ImageAndTextCell*) [cell copy]; //*******************************************************************************************************************
It’s a “well known”* fact that a copy of an NSCell or any subclass thereof basically doesn’t work. You have to override -copyWithZone: and Do It Properly™, which means NOT calling super’s implementation first (which internally uses NSCopyObject()). I suspect that’s the root cause of your issue.
* I say “well known” in quotes because it’s something that lurks there in the frameworks but is never spelt out in documentation, and almost every Mac OS developer comes up against it at some point and has to relearn this fact for themselves. This is your turn.
—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