• 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
Re: NSWindowController with NSObjectController doesn't dealloc
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWindowController with NSObjectController doesn't dealloc


  • Subject: Re: NSWindowController with NSObjectController doesn't dealloc
  • From: Shaun Wexler <email@hidden>
  • Date: Mon, 11 Oct 2004 16:25:32 -0700

On Oct 11, 2004, at 3:00 PM, Scott Stevenson wrote:
On Oct 11, 2004, at 10:52 AM, Shaun Wexler wrote:

The final solution: don't use bindings, until Apple fixes this huge bug, or leak like crazy.

This may makes sense for you since you have your own system that you can use instead, but saying that everyone else should toss out bindings wholesale because of this issue doesn't seem like a good idea.

The tone of my reply was semi-facetious; I guess I forgot the smiley. I use Cocoa bindings for the GUI layer, and SKW bindings for everything else, and they work together. What I meant in the above sentence was that we can simply ignore it and leak the objects in certain cases, or implement it traditionally if leaking is a huge problem. FWIW, all of the leaks or stale memory allocations in my app attribute to the underlying Carbon menu system, over which I don't have control.

There are at least one or two workarounds that are easily implemented and almost certain require less code than all the manual data manipulation you'd need without bindings. Dennis had simplest suggestion I've seen thus far, which is simply to create an NSObjectController to bind UI elements to, and populate the controller with -setContent after the nib wakes up:

http://www.cocoabuilder.com/archive/message/2004/7/28/113081

I also like the idea of being able to unbind just the contentArray of the controller, but I assume this won't fix the retain-cycle problem for any other bindings that go thru File's Owner (NSWindowController). Does anyone know if this is an IB bug, or actually in bindings themselves? When logging retains, I saw a huge amount of retain/autorelease pairs during bindings instantiation, and narrowed it down to one potential culprit... and now I can't find my notes with that info, but I recall that it was in one of the private bindings (adaptor?) classes.
--
Shaun Wexler
MacFOH
http://www.macfoh.com

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
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
References: 
 >NSWindowController with NSObjectController doesn't dealloc (From: Peter Schmidt <email@hidden>)
 >Re: NSWindowController with NSObjectController doesn't dealloc (From: Shaun Wexler <email@hidden>)
 >Re: NSWindowController with NSObjectController doesn't dealloc (From: Scott Stevenson <email@hidden>)

  • Prev by Date: IB and NSSplitView headaches
  • Next by Date: Re: Calling a method based on a string
  • Previous by thread: Re: NSWindowController with NSObjectController doesn't dealloc
  • Next by thread: setTitleWithRepresentedFilename weirdness
  • Index(es):
    • Date
    • Thread