Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: - (id)init



On Thursday, July 25, 2002, at 08:31 , Chong Hiu Pun wrote:

What's the difference between
- (id)init
and
- (void)awakeFromNib ? Which one should I do the initialization inside ?

What about reading some documentation first?

-init... is used for generic objects, made programmatically. -awakeFromNib is used only for objects made by loading them from a NIB (since they are _loaded_, not _inited_, init would not be called). For technical reasons it's a mite more complicated, but the simple rule is

- initialize your engine objects in their init... methods;
- initialize your controller objects (which are placed in NIBs) in their awakeFromNib methods.

As a matter of fact, so far as I understood your initial question properly,
you want none of them; what you (I think) are seeking for is the application delegate method applicationDidFinishLoading:.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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: 
 >- (id)init (From: "Chong Hiu Pun" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.