I have class A which inherits class B. And want to achieve something like below. But the init methods get recursive call due to dynamic typecasting. 
Is there any way to achieve such? Any suggestion? (without changing 'init's name in subclass?

```
@interface A : NSObject
@property NSData * data;
@end

```

---

```
@implementation A

- (id) init {
    self = [super init];
    /* want to do some default initialization here  
       for this class and all of its subclasses. */
    // ... ... 
    return self;
}

/* This [self init] get recursed. 
   But how can I force this class and all of its subclass to call [self init] above, 
   not to call the subclass's init method. */

- (id) initWithData:(NSData *)d {
    self = [self init];
    self.data = d;
    return self;
}

@end

```

---

```
@interface B : A

@end

```

---

```
#import "B.h"

@implementation B

- (id) init {
    self = [super initWithData:nil];
    // some subclass specific init code here ... 
    return 
}
@end

```

---

Using B,

```
- (void) testInit{
    B * b = [[B alloc] init];
}

```