objective c - iOS - method (in another class) executed twice -


i'm calling appcontroller viewcontroller upon viewdidload

@implementation viewcontroller     - (void)viewdidload { [super viewdidload];         nslog(@"viewdidload");         [appcontroller initialize];     } @end  @implementation appcontroller     + (void)initialize {         nslog(@"initialize");     } @end 

i expected initialize executed once. but, seen in console, it's executed twice.

log output

is bug or missing something?

+ (void)initialize method called objective-c runtime first time class referenced.

you should never call yourself, , never call super.

if you're looking setup on data controller override init.

here's similar answer


Comments

Popular posts from this blog

php - Magento - Deleted Base url key -

javascript - Tooltipster plugin not firing jquery function when button or any click even occur -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -