diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2017-03-06 21:39:14 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2017-03-06 21:39:14 -0800 |
commit | 2b5ceba288a3a3de4bceb6767953972b30f97f46 (patch) | |
tree | a20146363024d3895ef3bff3616dfa3eaa826c32 /CyteKit/Application.mm | |
parent | fd75908cce0497d8638b82870e5bc4ae215b31e3 (diff) |
CyteKit: {retain,release}NetworkActivityIndicator.
Diffstat (limited to 'CyteKit/Application.mm')
-rw-r--r-- | CyteKit/Application.mm | 21 |
1 files changed, 20 insertions, 1 deletions
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 |