Just another iPhone Blog
Quick Tip : Initializing static variables of a class in Objective C
Initializes the receiver before it’s used (before it receives its first message).
Discussion 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. (Thus the method may never be invoked if the class is not used.) The runtime sends the initialize message to classes in a thread-safe manner. Superclasses receive this message before their subclasses.
[Reference : NSObject Class Reference]
You can place all your static member variable initialization code in this method as it guarantees it would be called only once BEFORE any method in that Class is invoked through any of its objects.
Happy Coding 🙂