views:

342

answers:

1

In the BubbleLevel example from apple they implement an +initialize method. They say:

+initialize is invoked before the class receives any other messages, so it is a good place to set up application defaults

But when I try to look it up in the UIApplicationDelegate protocol documentation, they don't even mention that +initialize method. Are there more "hidden" methods I should know about? And how can I find them when they don't appear in the documentation of the protocol or class? Os is that inherited from somewhere else? How can I find out from where?

+4  A: 
  • (void)initialize is the NSObject's method

You can find it in documentation

http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/doc/uid/20000050-initialize

oxigen
General rule: if you don't find a function documented in the class, check its superclasses.
ashcatch
Thanks! I got used to the java principle, where you'll see all methods in the JavaDoc documentation, even if they come from superclasses (in that case the doc mentions it automatically). Would be cool if Apple does something similar, maybe optional. Shouldn't be that hard to inherit documentation if superclasses are known :)
Thanks