• 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
Re: Re: Binding to a Singleton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Binding to a Singleton (From: Mike Abdullah <email@hidden>)
 >Re: Binding to a Singleton (From: Andrei Tchijov <email@hidden>)
 >Re: Binding to a Singleton (From: Mike Abdullah <email@hidden>)
 >Re: Binding to a Singleton (From: Shaun Wexler <email@hidden>)

  • Prev by Date: Re: Pixel Size
  • Next by Date: CoreData Undo in Modal Dialog
  • Previous by thread: Re: Binding to a Singleton
  • Next by thread: Re: Binding to a Singleton
  • Index(es):
    • Date
    • Thread