Hi, I have a uiscrollview and I have one uiimageview object inside a uiscrollview. I am running the application. then I scroll to the right in scrollview and scrollview changes, but I do not see the following uiimageview object that I add to - (void) scrollViewDidEndDecelerating: (UIScrollView *) scrollView. before adding the next object, I delete the previous one ... what is wrong?
delete the object i am using
UIImageView *l;
for (NSInteger ko=0; ko<[[scroll subviews] count]; ko++){
if ([[[scroll subviews] objectAtIndex:0] isKindOfClass:[UIImageView class]]){
l=[[scroll subviews] objectAtIndex:0];
[l removeFromSuperview];
l=nil;
}
}
then I will add the following object
[scroll addSubview: imageView];
I delete the previous object because my application crashes when I add 110 images to the scrollview, so I need to manage the memory, I think. That is why I am deleting the previous object.
Help me please!