"Reloading" an NSBrowser bound to an NSTreeController
"Reloading" an NSBrowser bound to an NSTreeController
- Subject: "Reloading" an NSBrowser bound to an NSTreeController
- From: Adam Thorsen <email@hidden>
- Date: Fri, 11 Jan 2008 09:58:51 -0800
At various points throughout the execution of my app, I need to
refresh the data displayed in an NSBrowser with completely new data.
I have an NSBrowser(@millerBrowser) bound to an NSTreeController
(@treeController), which is in turn bound to an array of NSTreeNodes
(@remoteTree).
This is basically how I've been doing it (tree is the new data,
@remoteTree is the old data):
@remoteTree and tree are both NSArrays containing NSTreeNodes.
(@remoteTree removeAllObjects)
(tree each:(do (branch)
(@remoteTree addObject:branch)))
(set currentPath (@millerBrowser path))
(@treeController rearrangeObjects)
(@millerBrowser setPath:currentPath)
I've found that the problem with this is that it creates a HUGE memory
leak (2MB per shot). How can I safely replace the data without
causing a huge memory leak? Keep in mind that this is written in Nu,
which is garbage collected using reference counting, so all I have to
do is make sure the data in @remoteTree is no longer referenced.
Is there perhaps someway to remove the data through the
NSTreeController?
_______________________________________________
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