• 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: + initialize docs conflict?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: + initialize docs conflict?


  • Subject: Re: + initialize docs conflict?
  • From: Bill Cheeseman <email@hidden>
  • Date: Tue, 01 Feb 2005 18:17:40 -0500

on 2005-02-01 2:50 PM, Ricky Sharp at email@hidden wrote:

>> The typical "one-time only" implementation looks like this:
>>
>> @implementation MyClass
>> +initialize {
>>     if (self == [MyClass class]) {
>>         // do something once
>>     }
>> }
>
> mmalc also pointed this out in another e-mail.  I've been using this pattern
> already for +initialize in my NSControl subclasses.  I plan to use this
> pattern for all my initialize code (some still use a static flag).

What is the reason to prefer this over a static flag?

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com

PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes


 _______________________________________________
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

  • Follow-Ups:
    • Re: + initialize docs conflict?
      • From: Ali Ozer <email@hidden>
    • Re: + initialize docs conflict?
      • From: Ricky Sharp <email@hidden>
References: 
 >Re: + initialize docs conflict? (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: Drag from iTunes
  • Next by Date: Re: Drag from iTunes
  • Previous by thread: Re: + initialize docs conflict?
  • Next by thread: Re: + initialize docs conflict?
  • Index(es):
    • Date
    • Thread