I have a UIview which I am drawing a series of buttons on to. I want to change these buttons depending on a selection the user makes. This is working nicely... but I cannot remove the buttons which were already there.
It's a UIScrollView with a view added as a subview. It's the subview which I need to basically "clear" / wipe clean. In Interface builder there is nothing on that view. I simply add it in my code.
I've been looking around and have looked at doing subViewcontroller setNeedsDisplay, but nothing's working.
any ideas? thanks for any help.
I've actually figured out how to do what I needed... but I'd still be keen to see what people suggested.
I wanted to remove all the buttons in my view which was assigned to the UIScrollView. I KNOW they are only buttons being added, so I just looped through them all removing them one by one.
for (UIButton *aButton in [viewBasicItems subviews]) {
[aButton removeFromSuperview];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With