[Solved] XCODE Obj-C add UiimageView programatically in a for


You syntax is wrong. This is more what you need.

for (int i=0;i<3;i++){
  UIImageView *image=[[UIImageView alloc] initWithFrame:CGRectMake(i*50, 50, 250, 250)];
  [self.view addSubView:image];
}

However, this is not much use to you as your images are not referenced from anywhere so you can not populate or adjust them easily.

3

solved XCODE Obj-C add UiimageView programatically in a for