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: initWithCoder: called on objects in nibs



On Thursday, July 25, 2002, at 09:28 , Adrian Rutledge wrote:

I seem to recall someone saying that was the case, and suggesting using that to create an a single instance shared across several nib files. I took a try at this and my initWithcoder: doesn't get called, though I know the nib its in (MainMenu.nib) is being loaded. Its rather odd and frustrating. Did I misread the posts on here or am I just missing something obvious?

Nope. You are missing something pretty complicated instead.

For NIBbed objects, _sometimes_ initWithCoder: is used, but not always: it depends on whether the object is part of standard frameworks or not. The thing is, standard objects are just simply archived. Non-standard ones though are represented by a proxy, which effectively creates the needed instance instead of unarchiving itself; although the NIB thing is *conceptually* simple, in all details it is quite confusing.

I would really recommend *not* to go this way, unless you really have to. It can be done, but it is unnecessarily complicated for a vast majority of tasks.
---
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: 
 >initWithCoder: called on objects in nibs (From: Adrian Rutledge <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.