Iphone 如何在ipad应用程序中使用for循环生成按钮?
我想使用for循环生成按钮 大概是这样的:Iphone 如何在ipad应用程序中使用for循环生成按钮?,iphone,objective-c,cocoa-touch,ipad,Iphone,Objective C,Cocoa Touch,Ipad,我想使用for循环生成按钮 大概是这样的: button[] button = new button[10]; for(i=0;i<20;i++) { button[i].text = "some text"; } 按钮[]按钮=新按钮[10]; for(i=0;ifor(int i=0;i
button[] button = new button[10];
for(i=0;i<20;i++)
{
button[i].text = "some text";
}
按钮[]按钮=新按钮[10];
for(i=0;ifor(int i=0;i<20;i++){
UIButton*button=[UIButton button类型:…];
button.frame=CGRectMake(…);
[self.view addSubview:按钮];
}
用于(int i=0;i<20;i++){
UIButton*button=[UIButton button类型:…];
button.frame=CGRectMake(…);
[self.view addSubview:按钮];
}
ok…它是意外添加的…ok…它是意外添加的。。。
for (int i=0; i < 20; i++) {
UIButton *button = [UIButton buttonWithType:...];
button.frame = CGRectMake(...);
[self.view addSubview:button];
}