I have this code:
for(Contact *contact in myArray){
if(...){
UIImageView *fix = [[UIImageView alloc] initWithImage:myImage];
[self.view addSubview:fix];
[fix setFrame:[contact square]];
return;
}
}
in this code I add an imageView on self.view but in my app i call this “for” many times and finally I have my self.view with 4 or 5 imageView “fix”.
What’s the way to remove all these imageView from my self.view?
If you only want to remove instances of UIImageView, you can try something like this:
Update:
As vikingosegundo wrote in the comments, you can do this instad.
If you add each imageview to an array, you can remove them from the view later on like this:
The later on, remove them from the view: