Found something of interest, I noticed it during the use of UIScrollView. I was adding multiple UIImageView to scrollview dynamically, at some point later I was iterating through subviews of scrollview and doing some manipulation stuff. I was getting weird results. I printed a log for total count of scrollview’s subviews, found that total count was two more extra than I was supposed to have. I was adding five UIImageView to UIScrollView and total count of subview array was 7. Going more deeper with log prints, found that those two extra views were UIImageView [sighs] I was wondering how was those two extra UIImageView getting added to UIScrollView?

I removed all subviews from UIScrollView before adding my other UIImageView/s. This trick worked just partially. There were no extra two UIImageView and I was not getting any weird result from my processing code. I was thinking if it was some bug with UIScrollView but I was so wrong. I looked more closer to the output and found that two scroll indicators (horizontal and vertical) are missing :P, then it struck me that those two extra UIImageView were actually indicators. I changed my processing/iteration code instead of just plainly removing all subviews. All was well in the end.

Happy Valentines Day 🙂