• 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: Calling a class's methods from within it's +(void)initialize
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling a class's methods from within it's +(void)initialize


  • Subject: Re: Calling a class's methods from within it's +(void)initialize
  • From: Greg Hurrell <email@hidden>
  • Date: Tue, 2 Aug 2005 15:53:55 +0200

El 02/08/2005, a las 6:11, email@hidden escribió:

Yeah, so, subject is the question - is it safe to do this?

If I understand your question correctly, yes, it's perfectly safe. When you message a class you're really just messaging a special instance of it. See (from memory) the objc_getMetaClass() function.


If you send a message to "self" from inside your initialize method you're sending a message to that special instance. The Objective-C runtime is such that there will only ever be one such instance.

Greg

_______________________________________________
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: 
 >Calling a class's methods from within it's +(void)initialize (From: email@hidden)

  • Prev by Date: Problems with NSOutlineView and NSDictionary
  • Next by Date: [Core Data - Newbie] predicateWithValue: ?
  • Previous by thread: Calling a class's methods from within it's +(void)initialize
  • Next by thread: Re: Calling a class's methods from within it's +(void)initialize
  • Index(es):
    • Date
    • Thread