配列内のランダムボタンのタグを取得することは可能ですか?
- (IBAction)actionButtonPressed:(id)sender
{
NSUInteger randomIndex = arc4random()% [_allButtons count];
NSLog(@"%d", randomIndex);
NSLog(@"tag: %@",[_allButtons objectAtIndex:randomIndex]);
}
ログから私はこれを取得します:
UIRoundedRectButton:.... frame = (110 98; 50 44); opaque = NO; **tag = 5**; layer = CALayer.....
ランダムボタンからタグを取得することは可能ですか?
編集:申し訳ありませんが_allButtonsはNSMutableArrayです