views:

243

answers:

1

I have an iPhone application that uses a timer and every time it creates some UILabel and places it onto the UISrollview. What i want is to clear the scroll view every time before it puts UILabel onto the ScrollView.

So guys please help me to clear the contents of the UIScrollView. I'm just not been able to do that.

Looking for your reply

+3  A: 
for (UIView *subview in scrollView.subviews) {
  [subview removeFromSuperview];
}
Graham Lee
or in one line: [scrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
Vladimir
Thanks Graham, that's worked exactly fine for me. Thanks a lot....
Joy
@Vladimir: good one.
Graham Lee