有没有办法使用for循环来执行下面的代码,而不是必须输入重复?
bar1 = [[UIView alloc] init];
bar1.backgroundColor = [UIColor blueColor];
[self addSubview:bar1];
bar2 = [[UIView alloc] init];
bar2.backgroundColor = [UIColor blueColor];
[self addSubview:bar2];
bar3 = [[UIView alloc] init];
bar3.backgroundColor = [UIColor blueColor];
[self addSubview:bar3];
bar4 = [[UIView alloc] init];
bar4.backgroundColor = [UIColor blueColor];
[self addSubview:bar4];
bar5 = [[UIView alloc] init];
bar5.backgroundColor = [UIColor blueColor];
[self addSubview:bar5];