Possible duplicate:
How to find out if a UIViewController view is visible
I am developing an application that processes a constant stream of incoming data from the network and provides the user with various types of UIView for viewing this data.
When some model data is updated based on an incoming stream from the network, I refer to the corresponding UIViewController or UITableViewController and do -setNeedsDisplay on it (in the case of UIViewController) or -reloadData (in the case of UITableViewController).
Is there a way to check if a given UIView is currently being displayed (except that it is loading), so that I only do -setNeedsDisplay or -reloadData if the user is currently looking at this UIView? It would seem that calling -setNeedsDisplay or reloadData in a view that the user is not currently looking at is a waste of computing power and would not be useful for battery life. When the user eventually switches to a view that was previously updated, doing -setNeedsDisplay or reloadData in -viewWillAppear will make more sense.
thank
objective-c iphone
Paul Sep 09 '10 at 15:45 2010-09-09 15:45
source share