[super alloc] will call allocWithZone: which you redefined to do something else. To actually implement the implementation of the superclass allocWithZone: (what you need there) rather than the overridden version, you must explicitly send allocWithZone:
The super keyword represents the same object as self ; it simply tells the method dispatch mechanism to start looking for the appropriate method in the superclass, not the current class.
Thus, [super alloc] will go to the superclass and get there an implementation that looks something like this:
+ (id) alloc { return [self allocWithZone:NULL]; }
Here, self still represents your custom class, and thus, your overridden allocWithZone: , which will send your program in an infinite loop.
source share