Re: Arggg...overrelease in table view cell, but where?
Re: Arggg...overrelease in table view cell, but where?
- Subject: Re: Arggg...overrelease in table view cell, but where?
- From: Stuart Rogers <email@hidden>
- Date: Thu, 11 Dec 2008 22:37:28 +0000
I have implemented -copyWithZone in my NSTFC subclass as such:
- (id)copyWithZone:(NSZone *)zone
{
MyTableCell *copy = [super copyWithZone:zone];
copy.cellObject = [self.cellObject copy];
copy.gridController = [self.ViewController copy];
return copy;
}
NSCells use NSCopyObject to do their copies, which ends up setting the
values of cellObject and gridController in your copies, but not
retaining them. You need to nil them out before setting the values in
your properties. This is a long-standing misbehavior of NSCell that
probably wont be changing anytime soon.
Just in case Corbin misses the opportunity to reference it yet again,
see ImagePreviewCell.m in:
<http://developer.apple.com/samplecode/PhotoSearch/>
Stuart
_______________________________________________
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