LoginSignup
8
7

More than 5 years have passed since last update.

initializeクラスメソッドの記述例

Posted at

initializeクラスメソッドは、クラスを初めて使用するときに呼ばれる。
ただし、継承しているとサブクラスから呼ばれることもあるので、2回呼ばれてもいいようにしておく。

initializeサンプル
+ (void) initialize
{
    static BOOL bInitialized = NO;
    if (bInitialized) {
        return;
    }
    // do anything.
    bInitialized = YES;
}
8
7
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
7