• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
"Reloading" an NSBrowser bound to an NSTreeController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"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


  • Prev by Date: Re: NSPanel hides with GC enabled
  • Next by Date: NSRuleEditor
  • Previous by thread: Re: NSPanel hides with GC enabled
  • Next by thread: "Reloading" an NSBrowser bound to an NSTreeController
  • Index(es):
    • Date
    • Thread