Skip to content
This repository was archived by the owner on Jan 17, 2023. It is now read-only.

Commit 9b1bd35

Browse files
committed
[Issue #22] Testing with respondsToSelector: rather than isKindOfClass: for AFNetworkRequestFromNotification()
1 parent 7a2a55e commit 9b1bd35

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

AFNetworkActivityLogger/AFNetworkActivityLogger.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828

2929
static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notification) {
3030
NSURLRequest *request = nil;
31-
if ([[notification object] isKindOfClass:[AFURLConnectionOperation class]]) {
32-
request = [(AFURLConnectionOperation *)[notification object] request];
33-
} else if ([[notification object] respondsToSelector:@selector(originalRequest)]) {
31+
if ([[notification object] respondsToSelector:@selector(originalRequest)]) {
3432
request = [[notification object] originalRequest];
33+
} else if ([[notification object] respondsToSelector:@selector(request)]) {
34+
request = [[notification object] request];
3535
}
3636

3737
return request;

0 commit comments

Comments
 (0)