Re: Re: Binding to a Singleton
Re: Re: Binding to a Singleton
- Subject: Re: Re: Binding to a Singleton
- From: "Raphael Sebbe" <email@hidden>
- Date: Thu, 28 Sep 2006 14:43:50 +0200
Hi,
This is not exact. IB can encode an object only when it has access to
the -encodeWithCoder: method, which is not the case when you
instantiate it from a .h in IB (but may be the case when you build a
plugin for IB). Instead, what happens is that a proxy is created in
the nib, and when the application loads it, the actual object is
created with the -init method (not initWithCoder:)
Raphael
On 9/26/06, Shaun Wexler <email@hidden> wrote:
A nib file contains archived copies of your objects, which are
instantiated in the app using -initWithCoder: and that ultimately
calls -init on your object. Your singleton class should override
+allocWithZone: to prevent the creation of additional objects. Your
singleton instance can then intercept either of the init methods as
well as -awakeFromNib, and deal with the nib accordingly. You do not
want to use the singleton as File's Owner for outlet or binding
purposes though.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden