• 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
-awakeFromNib, application releasing...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

-awakeFromNib, application releasing...


  • Subject: -awakeFromNib, application releasing...
  • From: Jeremy Faller <email@hidden>
  • Date: Wed, 2 Jul 2003 07:37:48 -0700

All:


Hello all. I have encountered something in Cocoa, that I can't explain, and would like to know why I'm so silly.

Starting from a New Cocoa Application (non-doc based).

Let's pretend I create an Obj-C class Foo, and write the -init, -release, and and -awakeFromNib methods to just NSLog(@"...."). Additionally, I am going to load Foo.h into my MainMenu.nib file, and instantiate a Foo there.

When the application runs, it just prints the following:

2003-07-02 07:32:31.895 Test[4585] In init!
2003-07-02 07:32:31.901 Test[4585] In awake!
2003-07-02 07:32:31.902 Test[4585] In release!
2003-07-02 07:32:32.005 Test[4585] In release!

If I eliminate the -awakeFromNib method, the -release is never called, and my Foo object sticks around. What's going on, and why is -release getting called twice? (I have tried this on 2 machines running 10.2.6, and get the same results on both.)


Jeremy Faller
email@hidden
_______________________________________________
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.

  • Follow-Ups:
    • Re: -awakeFromNib, application releasing...
      • From: James Quick <email@hidden>
    • Re: -awakeFromNib, application releasing...
      • From: Jeff Harrell <email@hidden>
  • Prev by Date: Merging BezierPath
  • Next by Date: Re: -awakeFromNib, application releasing...
  • Previous by thread: Re: Merging BezierPath
  • Next by thread: Re: -awakeFromNib, application releasing...
  • Index(es):
    • Date
    • Thread