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.
NSMutableArrayという名前のインスタンスがありますmyArray。8 つのボタン オブジェクトが含まれています。整数変数にテープで貼り付けたボタンのインデックスを取得するにはどうすればよいですか?
NSMutableArray
myArray
NSArrayと呼ばれるメソッドがありますindexOfObject
NSArray
indexOfObject
- (IBAction)pushButton:(id)sender { NSButton *button = (NSButton *)sender; NSUInteger index = [Array indexOfObject:button]; }