Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
UIButton * button = [self valueForKey: [NSString stringWithFormat: @"buttonA"];
「自己」という言葉を使わずに同じことをする方法はありますか?
selfクラスの現在のインスタンスです。
self
そして、これが最善の方法です。
自分以外に、オブジェクトの別のインスタンスを作成し、そのオブジェクトを使用する必要があります。
MyClass *classObject=[MyClass new]; UIButton * button = [classObject valueForKey: [NSString stringWithFormat: @"buttonA"];