クラス A と、A のサブクラスであるクラス B があります。どちらにも次のメソッドがあります。
-(void)anotherMethod{
// implementation of A or B
}
-(void)aMethod{
@try{
[super aMethod];
}
@catch(NSException *e){
}
[self anotherMethod];
}
今:Aの呼び出しの実装に含まれる[instanceOfClassB aMethod]
命令を呼び出すと(オーバーライドされているため)、Aの呼び出しの代わりにBの呼び出しが行われます。A のcallの実装を A の の実装にするにはどうすればよいですか?[self anotherMethod]
aMethod
anotherMethod
aMethod
anotherMethod