Access Method Objects from Outside of Its Scope?
I create and apply animation to an indefinite number of UIImageView's within my method. Later at some point I need to 开发者_运维问答access UIImageView's to animate them differently or apply some transitions.
I want to find out the best possible way to access them from another method. I thought of using a View Controller's Mutable Array to add them there and later loop through it to retrieve the object I need but I do not know if it's possible.
Thanks in advance.
You should be able to use the [self.view subviews] array. You could loop through that and test if the view is a UIImageView. Alternatively, you could set the "tag" property of the views you need to animate when you create them and test for that.
精彩评论