diff options
Diffstat (limited to 'CyteKit')
-rw-r--r-- | CyteKit/Application.h | 3 | ||||
-rw-r--r-- | CyteKit/Application.mm | 21 |
2 files changed, 23 insertions, 1 deletions
diff --git a/CyteKit/Application.h b/CyteKit/Application.h index d95ad1c..84355c1 100644 --- a/CyteKit/Application.h +++ b/CyteKit/Application.h @@ -28,6 +28,9 @@ - (void) applicationDidFinishLaunching:(id)unused; +- (void) retainNetworkActivityIndicator; +- (void) releaseNetworkActivityIndicator; + @end #endif//CyteKit_Application_H diff --git a/CyteKit/Application.mm b/CyteKit/Application.mm index 77b1260..025cbd7 100644 --- a/CyteKit/Application.mm +++ b/CyteKit/Application.mm @@ -30,7 +30,8 @@ #include "iPhonePrivate.h" #include <Menes/ObjectHandle.h> -@implementation CyteApplication : UIApplication { +@implementation CyteApplication { + unsigned activity_; } - (void) _sendMemoryWarningNotification { @@ -66,4 +67,22 @@ ] autorelease]]; } +- (void) retainNetworkActivityIndicator { + if (activity_++ == 0) + [self setNetworkActivityIndicatorVisible:YES]; + +#if TraceLogging + NSLog(@"retainNetworkActivityIndicator->%d", activity_); +#endif +} + +- (void) releaseNetworkActivityIndicator { + if (--activity_ == 0) + [self setNetworkActivityIndicatorVisible:NO]; + +#if TraceLogging + NSLog(@"releaseNetworkActivityIndicator->%d", activity_); +#endif +} + @end |