私はこれを学び始めたばかりなので、これがまだ理解できない明らかな解決策がある場合は申し訳ありません。
私はこれらの2つのクラスを持っています:
@implementation Person
-(void)saySomething:(NSString*) something {
NSLog(@"%@",something);
}
-(void)yellSomething:(NSString*) something {
[self saySomething:[something uppercaseString]];
}
@end
と
@implementation ShoutingPerson : Person
-(void)saySomething:(NSString*)something {
[super yellSomething:something];
}
@end
saySomething
は常に子孫クラスで呼び出されるため、これにより循環参照呼び出しが発生します。
子孫クラスではなくクラスでメソッドをyellSomething
呼び出すにはどうすればよいですか?saySomething
Person