iphone - Remove subview UIImageview from UIScrollView -
Hello I have a realviewview and I have an object of uiimageview inside uisrollview. If I start the app then I scrollview and scrollview to scroll to the right on the change, but I can see the next uiimageview object that I add - scrollViewDidEndDecelerating (Zero): (UIScrollView *) scrollView. Before I add the next object, I remove the last ... what is wrong?
To use the object
UIImageView * l; ([[[[[Scroll SubViews] ObjectTyndex: 0] Hackandoff Class: [UIImageView class]]) // {This code is never killed l = [[Scroll SubViews] ObjectOtindex: 0]; [Extraction Prospective]; L = equal to no; }}
Then I add the next object
[scroll addSubview: imageView];
I remove the previous object because my app crashes. To add 110 images to scrollview, I think the management of memory is the reason that I remove the previous object .
Any help please!
A few of the tips to get you on the right track:
- < Li>
-
The property of the tag of a UIView is your best friend, when you are trying to avoid maintaining problems with your loops. You can set a specific tag for your UIImageView, when you can require them, and then search for the tag using [UIView viewWithTag: tag]; It works recursively
-
st3fan brings a very good issue about concurrent modification. In general, a good way to avoid it is to add it to the "extinction array" and then remove the object inarray.
If you think the memory is an issue, then split the problem. For example, add / remove 10 images at a time.
Comments
Post a Comment