OutlineView crashing on collapse (need help badly)
OutlineView crashing on collapse (need help badly)
- Subject: OutlineView crashing on collapse (need help badly)
- From: "Jean-Olivier Lanctôt-D." <email@hidden>
- Date: Sun, 4 Apr 2004 14:11:28 -0400
Hi,
I rely a lot on an NSOutlineView to manage items in my app.
Since the beginning, I've been bothered by a very weird bug. I select
items in the outlineview, and collapse a group, and the app crashes.
stack:
#0 0x90191054 in CFRetain
#1 0x9019cbe4 in CFDictionaryAddValue
#2 0x901ae4ec in CFDictionaryCreate
#3 0x909fc494 in -[NSPlaceholderDictionary
initWithObjects:forKeys:count:]
#4 0x90a01798 in +[NSDictionary dictionaryWithObjectsAndKeys:]
#5 0x930b86e8 in -[NSOutlineView _postItemDidCollapseNotification:]
#6 0x930b71a8 in -[NSOutlineView
_collapseItemEntry:collapseChildren:clearExpandState:recursionLevel:]
#7 0x930b6ed4 in -[NSOutlineView
_collapseItem:collapseChildren:clearExpandState:]
#8 0x930b9700 in -[NSOutlineView collapseItem:collapseChildren:]
#9 0x930b8188 in -[NSOutlineView
_doUserExpandOrCollapseOfItem:isExpand:optionKeyWasDown:]
#10 0x930b9e00 in -[NSOutlineView
mouseTracker:didStopTrackingWithEvent:]
#11 0x92f9e1d8 in -[NSMouseTracker stopTrackingWithEvent:]
#12 0x92f9d87c in -[NSMouseTracker trackWithEvent:inView:withDelegate:]
#13 0x92f38d68 in -[NSOutlineView mouseDown:]
#14 0x92e02c60 in -[NSWindow sendEvent:]
#15 0x92df5324 in -[NSApplication sendEvent:]
#16 0x92dfd73c in -[NSApplication run]
#17 0x92eb9b80 in NSApplicationMain
#18 0x004f8f74 in main at main.m:13
I have absolutely no idea on WHY this bug happens, but I've been able
to circumvent it via this cheap hack
- (BOOL)outlineView:(NSOutlineView *)outlineView
shouldCollapseItem:(id)item
{
// hack :\ or else, crash. WTF?!
if ([item superItem]) {
[outlineView selectRow:[outlineView rowForItem:[item superItem]]
byExtendingSelection:NO];
} else
[outlineView selectRow:[outlineView rowForItem:item]
byExtendingSelection:NO];
return YES;
}
But now it's become too infancy for final release, and I've added a
"Collapse All" action in the toolbar that makes the app crash too.
(Same problem, I guess)
What am I doing wrong, this seems to be a datasource problem (I've been
searching for solution on the archives and found none, but it looked
like a lot of coders had the same problem, namely Mr. Rice from
MindLube)
Please help!
--Jean-Olivier Lancttt-D.
_______________________________________________
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.