|
From: | Fred Kiefer |
Subject: | Re: NSActionCell _control_view |
Date: | Mon, 29 Dec 2003 12:35:45 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821 |
Rob Burns wrote:
I'm having problems displaying an NSTableView. when I run my app, sometimes it will behave as expected and display the contents of the NSTableView. And other times it will segfault when displaying the first item. This appears to be becuase the _control_view instance variable of NSActionCell gets set to something other than the NSTableView, in which the cell is being displayed. The gdb output thats attached shows this. also in my program I can print this variable when ever a cell is drawn by putting this:NSLog(@"cell control view - %@", [[aCell controlView] description]); in - (void) tableView: (NSTableView *) aTableView willDisplayCell: (id) aCell forTableColumn: (NSTableColumn *) aTableColumn row: (int) rowIndexwhen the app functions correctly, a description of the NSTableView is printed. When the _control_view variable has gotten set to something else, it will sefgault on the NSLog. The program can be found here:
It did not segfault for me, but printed the following:2003-12-29 11:57:56.052 Pimzler[3377] cell control view - <GSControlTemplate: 833c4b0> 2003-12-29 11:57:56.053 Pimzler[3377] cell control view - <GSControlTemplate: 833c4b0>
Looks like the Gorm prototype is still stored in the NSActionCell when you are about to display it. One easy fix for this could be not to encode/decode the control view with the NSActionCell. I am not sure why this gets stored at all.
On the other hand I also don't see, why your application should fail over this. Hmm, maybe the GSControlTemplate has by that time already been freed, as the control view is not retained and you are now referencing an invalid object. Yes, that might do.
I just tested with setting _control_view to nil in [NSActionCell initWithCoder:] and that would work. But we need more input on the side effects of this change or better solutions to it. Best you report this as a bug in the Savannah form, so it wont get lost.
Cheers Fred
[Prev in Thread] | Current Thread | [Next in Thread] |