Re: NSTableView and check boxes (for the hundredth time)
Re: NSTableView and check boxes (for the hundredth time)
- Subject: Re: NSTableView and check boxes (for the hundredth time)
- From: Brent Gulanowski <email@hidden>
- Date: Thu, 3 Oct 2002 15:46:59 -0400
On Thursday, October 3, 2002, at 09:03 AM, Vladimir Pilipyuk wrote:
NSButtonCell *protoCell;
protoCell=[[NSButtonCell alloc] init];
[protoCell setButtonType:NSSwitchButton];
[protoCell setImagePosition:NSImageOnly];
[protoCell setTitle:@""];
[checkboxColumn setDataCell:protoCell];
The protoCell should be released here. It is now retained by
checkboxColumn.
I'll save Ondra the trouble by adding that you should autorelease
immediately upon init, avoiding the danger of memory leak due to
uncaught exception which might be raised in between separated init and
release messages.
(protoCell = [[[NSButtonCell alloc] init] autorelease]; )
--
Brent Gulanowski email@hidden
I bought some batteries... but they weren't included... so I had to buy
them again. - Stephen Wright
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.