File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,8 @@ - (id)init {
62
62
return nil ;
63
63
}
64
64
65
- [[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (incrementActivityCount ) name: AFNetworkingOperationDidStartNotification object: nil ];
66
- [[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (decrementActivityCount ) name: AFNetworkingOperationDidFinishNotification object: nil ];
65
+ [[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (networkingOperationDidStart: ) name: AFNetworkingOperationDidStartNotification object: nil ];
66
+ [[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (networkingOperationDidFinish: ) name: AFNetworkingOperationDidFinishNotification object: nil ];
67
67
68
68
return self;
69
69
}
@@ -126,6 +126,20 @@ - (void)decrementActivityCount {
126
126
[self updateNetworkActivityIndicatorVisibilityDelayed ];
127
127
}
128
128
129
+ - (void )networkingOperationDidStart : (NSNotification *)notification {
130
+ AFURLConnectionOperation *connectionOperation = [notification object ];
131
+ if (connectionOperation.request .URL ) {
132
+ [self incrementActivityCount ];
133
+ }
134
+ }
135
+
136
+ - (void )networkingOperationDidFinish : (NSNotification *)notification {
137
+ AFURLConnectionOperation *connectionOperation = [notification object ];
138
+ if (connectionOperation.request .URL ) {
139
+ [self decrementActivityCount ];
140
+ }
141
+ }
142
+
129
143
@end
130
144
131
145
#endif
You can’t perform that action at this time.
0 commit comments