Created
September 14, 2008 23:29
-
-
Save mmower/10778 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @implementation A | |
| - (id)initWithX:(id)x { | |
| if( self = [self init] ) { | |
| // do with x | |
| } | |
| return self; | |
| } | |
| @end | |
| @implementation B | |
| - (id)initWithX:(id)x { | |
| return [super initWithX:x]; | |
| } | |
| - (id)init { | |
| return [super initWithX:defaultX]; | |
| } | |
| @end | |
| [[B alloc] init] -> stack overflow | |
| B init calls A initWithX which calls init, which ends up in B init | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment