EXC_BAD_ACCESS down inside [NSOutlineView reloadItem:reloadChildren];
EXC_BAD_ACCESS down inside [NSOutlineView reloadItem:reloadChildren];
- Subject: EXC_BAD_ACCESS down inside [NSOutlineView reloadItem:reloadChildren];
- From: Graham Cox <email@hidden>
- Date: Tue, 3 Feb 2009 10:34:49 +1100
I'm getting a crash (EXC_BAD_ACCESS) inside an internal NSOutlineView
method. I'm sure it's my own fault but I'd like to know where I should
be looking to fix it. The stack trace is:
#0 0x92abf112 in -[NSOutlineView
_adjustSelectionForItemEntry:numberOfRows:adjustFieldEditorIfNecessary:]
#1 0x92c1ef9a in -[NSOutlineView reloadItem:reloadChildren:]
#2 0x0009cfce in -[DKOLayerController layerStatusChange:] at
DKOLayerController.m:278
#3 0x941c3e1a in _nsnote_callback
The exact line it crashes at is here:
0x92abf0fa <+0171> je 0x92abf12b <-[NSOutlineView
_adjustSelectionForItemEntry:numberOfRows:adjustFieldEditorIfNecessary
:]+220>
0x92abf0fc <+0173> xor íi,íi
0x92abf0fe <+0175> mov -0x20(ëp),êx
0x92abf101 <+0178> mov 0x4(êx),ìx
0x92abf104 <+0181> dec ìx
0x92abf105 <+0182> lea 0x0(,ìx,4),íx
0x92abf10c <+0189> jmp 0x92abf118 <-[NSOutlineView
_adjustSelectionForItemEntry:numberOfRows:adjustFieldEditorIfNecessary
:]+201>
0x92abf10e <+0191> mov 0x18(%esi),êx
0x92abf111 <+0194> dec ìx
0x92abf112 <+0195> add (íx,êx,1),íi <---------------- crash
0x92abf115 <+0198> sub $0x4,íx
0x92abf118 <+0201> test ìx,ìx
0x92abf11a <+0203> jns 0x92abf10e <-[NSOutlineView
_adjustSelectionForItemEntry:numberOfRows:adjustFieldEditorIfNecessary
:]+191>
0x92abf11c <+0205> mov (%esi),êx
0x92abf11e <+0207> inc íi
0x92abf11f <+0208> test êx,êx
0x92abf121 <+0210> je 0x92abf12a <-[NSOutlineView
_adjustSelectionForItemEntry:numberOfRows:adjustFieldEditorIfNecessary
:]+219>
0x92abf123 <+0212> mov %esi,-0x20(ëp)
0x92abf126 <+0215> mov êx,%esi
0x92abf128 <+0217> jmp 0x92abf0fe <-[NSOutlineView
_adjustSelectionForItemEntry:numberOfRows:adjustFieldEditorIfNecessary
:]+175>
The method I'm calling -reloadItem:reloadChildren from is a
notification handler:
- (void) layerStatusChange:(NSNotification*) aNote
{
DKLayer* layer = [aNote object];
//NSLog(@"layers controller got status change for layer %@", layer );
if([mLayersTable rowForItem:layer] != -1)
{
BOOL expand = [mLayersTable isItemExpanded:layer];
if( expand )
{
[mLayersTable reloadItem:layer reloadChildren:YES]; //<------
crashes here
[mLayersTable expandItem:layer];
}
else
{
// ... other code (irrelevant) ...
}
At this point all the data looks good - I have a valid object for
<layer> and <expand> returns as YES.
The outline view is an interface to a hierarchical list of layers, and
this is responding to a reordering of the layers within a group that
was triggered externally - i.e. not by interacting with the outline
view itself. The notification is sent by the containing group of the
layer being reordered and it's this group that is returned by [note
object].
tia,
--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