• 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: + (void) initialize not getting called
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: + (void) initialize not getting called


  • Subject: Re: + (void) initialize not getting called
  • From: Gabriel Roth <email@hidden>
  • Date: Sun, 24 Jul 2011 15:43:09 -0400

On Sun, Jul 24, 2011 at 3:33 PM, Ken Tozier <email@hidden> wrote:
> I wrote a class that stores data common to all instances in an, init file, but when I create new instances, + (void) initialize isn't getting called.

I can't tell for sure from your email, but it seems like you might be
expecting initialize to be called whenever you create a new instance
of your class.

>From the NSObject documentation:
"The runtime sends initialize to each class in a program exactly one
time just before the class, or any class that inherits from it, is
sent its first message from within the program."

So creating a new instance won't trigger an initialize message unless
it's the very first message sent to your class.

Sorry if I've misunderstood.

gr.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: + (void) initialize not getting called
      • From: "Gary L. Wade" <email@hidden>
References: 
 >+ (void) initialize not getting called (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: Does anyone else dislike Xcode 4?
  • Next by Date: Re: Does anyone else dislike Xcode 4?
  • Previous by thread: + (void) initialize not getting called
  • Next by thread: Re: + (void) initialize not getting called
  • Index(es):
    • Date
    • Thread