Committed by
Ben Copsey
Execute completionBlock before requestDidFinishSelector and queueDidFinishSelector callbacks
Showing
1 changed file
with
5 additions
and
5 deletions
@@ -1940,17 +1940,17 @@ static NSOperationQueue *sharedQueue = nil; | @@ -1940,17 +1940,17 @@ static NSOperationQueue *sharedQueue = nil; | ||
1940 | /* ALWAYS CALLED ON MAIN THREAD! */ | 1940 | /* ALWAYS CALLED ON MAIN THREAD! */ |
1941 | - (void)reportFinished | 1941 | - (void)reportFinished |
1942 | { | 1942 | { |
1943 | +#if NS_BLOCKS_AVAILABLE | ||
1944 | + if(completionBlock){ | ||
1945 | + completionBlock(); | ||
1946 | + } | ||
1947 | +#endif | ||
1943 | if (delegate && [delegate respondsToSelector:didFinishSelector]) { | 1948 | if (delegate && [delegate respondsToSelector:didFinishSelector]) { |
1944 | [delegate performSelector:didFinishSelector withObject:self]; | 1949 | [delegate performSelector:didFinishSelector withObject:self]; |
1945 | } | 1950 | } |
1946 | if (queue && [queue respondsToSelector:@selector(requestFinished:)]) { | 1951 | if (queue && [queue respondsToSelector:@selector(requestFinished:)]) { |
1947 | [queue performSelector:@selector(requestFinished:) withObject:self]; | 1952 | [queue performSelector:@selector(requestFinished:) withObject:self]; |
1948 | } | 1953 | } |
1949 | -#if NS_BLOCKS_AVAILABLE | ||
1950 | - if(completionBlock){ | ||
1951 | - completionBlock(); | ||
1952 | - } | ||
1953 | -#endif | ||
1954 | } | 1954 | } |
1955 | 1955 | ||
1956 | /* ALWAYS CALLED ON MAIN THREAD! */ | 1956 | /* ALWAYS CALLED ON MAIN THREAD! */ |
-
Please register or login to post a comment