• 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
ObjectController preventing window from closing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ObjectController preventing window from closing


  • Subject: ObjectController preventing window from closing
  • From: Jonathan Taylor <email@hidden>
  • Date: Mon, 07 Nov 2011 16:08:13 +0000

Hi all,

This is probably a very basic question, but I am out of ideas and hoping someone can offer some help. I should say that I'm afraid I'm somewhat out of my depth with ObjectControllers: I added some seemingly simple bindings at the recommendation of a poster on here, and I thought I understood what it was doing, but the fact that I am now having retain issues suggests otherwise!

I have a window and window controller which in the absence of an object controller work fine, and both are deallocated when the window is closed. If I add an ObjectController to the NIB and bind its "Content Object" to "File's Owner.self" then the window no longer closes properly. The window disappears from the screen but the controller is not released as it should be. I get a windowWillClose notification, but the one [self autorelease] that I do from there is not enough to release the window. The controller appears to be still retained by the ObjectController. In the actual NIB there are various GUI elements bound to the object controller, but I have removed all those bindings, just leaving the single binding from the OC to "File's Owner.self" and I still have this problem of non-deallocation. If I remove that final binding, so the object controller is completely isolated, the window controller releases as one would expect (though I suspect the object controller may be leaked).

Is there something important that I should be doing here? Should I somehow be releasing the object controller, or indicating to it that it is no longer required? I realise that the information I've given here may be incomplete, because I don't even know what factors may be important in understanding the problem! Any advice would be very welcome though, as I am completely out of ideas...

Regards,
Jonathan._______________________________________________

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

  • Follow-Ups:
    • ObjectController preventing WindowController from releasing
      • From: Jonathan Taylor <email@hidden>
  • Prev by Date: Re: Allocating too much memory kills my App rather than returning NULL
  • Next by Date: ObjectController preventing WindowController from releasing
  • Previous by thread: What is the right way to move a UIDocument to a new URL?
  • Next by thread: ObjectController preventing WindowController from releasing
  • Index(es):
    • Date
    • Thread