I add 10 buttons to UIScrollView
for开发者_Python百科 (int i=0; i<10; i++) {
UIButton *btn = ....
[ScrollView addSubview:btn];
}
How can i refer to each button ?
btn.tag = i;
and later,
[scrollView viewWithTag: 2];
Either set the tag on each view, and find them using viewWithTag, or save references to each in an NSMutableArray or other data structure.
精彩评论