Crash when expanding outlineview bound to CoreData
Crash when expanding outlineview bound to CoreData
- Subject: Crash when expanding outlineview bound to CoreData
- From: Rod Schmidt <email@hidden>
- Date: Fri, 9 Dec 2005 20:09:55 -0700
I have an outline view bound to an NSTreeController that uses
CoreData. Everything works fine except I want the outline view be
completely expanded. So I wrote the following code:
NSMutableArray* items = [NSMutableArray array];
int row;
for (row = 0; row < [listsView numberOfRows]; row++)
{
id item = [listsView itemAtRow: row];
if ([listsView isExpandable: item])
[items addObject: item];
}
NSEnumerator* iter = [items objectEnumerator];
id item;
while (item = [iter nextObject])
{
[listsView expandItem: item];
}
This does indeed expand everything. However, the program soon
crashes. Here's the stack trace:
#0 0x9073fba4 in CFRetain
#1 0x92964b60 in _NSKeyValueObservationInfoCreateByRemoving
#2 0x92964938 in -[NSObject(NSKeyValueObserverRegistration)
_removeObserver:forProperty:]
#3 0x92964828 in -[NSObject(NSKeyValueObserverRegistration)
removeObserver:forKeyPath:]
#4 0x93ba9644 in -[_NSArrayControllerTreeNode _clearObserving]
#5 0x93ba9418 in -[_NSArrayControllerTreeNode dealloc]
#6 0x90755d74 in __CFSetDeallocate
#7 0x9073d554 in _CFRelease
#8 0x928baea8 in NSPopAutoreleasePool
#9 0x928e91c4 in __NSFireDelayedPerform
#10 0x90770aec in __CFRunLoopDoTimer
#11 0x9075d464 in __CFRunLoopRun
#12 0x9075ca18 in CFRunLoopRunSpecific
#13 0x931861e0 in RunCurrentEventLoopInMode
#14 0x93185874 in ReceiveNextEventCommon
#15 0x931856e0 in BlockUntilNextEventMatchingListInMode
#16 0x93684904 in _DPSNextEvent
#17 0x936845c8 in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:]
#18 0x93680b0c in -[NSApplication run]
#19 0x93771618 in NSApplicationMain
#20 0x00044fac in main at main.m:13
So it looks like there is some kind of memory problem. I've tried
calling rearrangeObjects on the tree controller. This worked at
first, but after I added some more functionality in the app it
started crashing again. If a comment out the code that does the
expansion everything is fine. Can any of the CoreData/Bindings
experts out there tell me what I'm doing wrong?
Thanks,
Rod Schmidt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden