tl;dr
It turns out that
NSArray *subviews = [myScrollView subviews];
will indeed return all the subviews in a UIScrollView *myScrollView
, even if they are off-screen.
The Details
The problem I was actually having was that the scroll view I was trying to use this on was actually a UITableView
, and when a UITableViewCell
in a UITableView
goes off-screen, it actually gets removed from the UITableView
- so by the time I was calling subviews
, the cells I was looking for were no longer in the scroll view.
My workaround was to build all of my UITableViewCell
s in a separate method called by my viewDidLoad
, then put all of those cells into an array. Then, instead of using subviews
, I just used that array. Of course, doing it this way hurts the performance a little (in cellForRowAtIndexPath
you just return the cell from the array, which is slower than the dequeueReusableCellWithIdentifier
method that is typically used), but it was the only way I could find to get the behavior I needed.