• 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: deallocating instances instantiated in IB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: deallocating instances instantiated in IB


  • Subject: Re: deallocating instances instantiated in IB
  • From: Thomas Harrington <email@hidden>
  • Date: Wed, 10 Jul 2002 21:22:00 -0600

On Wednesday, July 10, 2002, at 03:35 PM, Chaz wrote:

Any instances I use by instantiating in IB do not get deallocated, so I'm guessing it must be somehow my responsibility to do so. So where and how do I do this? Actually, let me briefly explain my setup to see if I even have the right approach:

I have two windows in my application that shouldn't be open at the same time. One of the windows needs to open itself at launch. So what I've done is have that window "visible at launch time." Then the user will do some things in the first window, click "OK," and the second window comes up after the first closes. Should the first window be release?

As I've been led to believe (I think by Aaron Hillegass' book, but don't blame him if I'm getting it wrong), the usual approach is to just hide the window and not concern yourself with releasing it.

And should the second window be created at startup, and then shown when I need it...or do I have a choice for that matter? Should windows go into separate nib files?

What I'd do is put the second window in a separate nib, and then load it when it's needed using NSBundle's +loadNibNamed method. Once loaded, tell the window to -makeKeyAndOrderFront:. That's not the only solution but it'll do the job nicely.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >deallocating instances instantiated in IB (From: Chaz <email@hidden>)

  • Prev by Date: Re: [OT]: "Developer DVD" nearly unusable?
  • Next by Date: NSTask, NSFileHandle, readInBackgroundAndNotify and avoiding polling
  • Previous by thread: deallocating instances instantiated in IB
  • Next by thread: Re: deallocating instances instantiated in IB
  • Index(es):
    • Date
    • Thread