-awakeFromNib, application releasing...
-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.