From 2198484458e887ec3c7c0e15497c81f52dba5619 Mon Sep 17 00:00:00 2001 From: "Hoa V. DINH" Date: Sun, 23 Feb 2014 18:15:23 -0800 Subject: Fixed #608: cancelled scheduled operations that are not run will not run in the future. --- src/objc/utils/MCOOperation.h | 4 +++- src/objc/utils/MCOOperation.mm | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/objc/utils') diff --git a/src/objc/utils/MCOOperation.h b/src/objc/utils/MCOOperation.h index 263d4a46..f46536c9 100644 --- a/src/objc/utils/MCOOperation.h +++ b/src/objc/utils/MCOOperation.h @@ -17,6 +17,9 @@ /** Returns whether the operation is cancelled.*/ @property (readonly) BOOL isCancelled; +/** Returns whether the operation should run even if it's cancelled.*/ +@property (nonatomic, assign) BOOL shouldRunWhenCancelled; + /** The queue this operation dispatches the callback on. Defaults to the main queue. This property should be used only if there's performance issue creating or calling the callback in the main thread. */ @@ -29,7 +32,6 @@ /** Cancel the operation.*/ - (void) cancel; - @end #endif diff --git a/src/objc/utils/MCOOperation.mm b/src/objc/utils/MCOOperation.mm index 7502afae..cabb9a61 100644 --- a/src/objc/utils/MCOOperation.mm +++ b/src/objc/utils/MCOOperation.mm @@ -82,6 +82,7 @@ public: } MCO_OBJC_SYNTHESIZE_SCALAR(dispatch_queue_t, dispatch_queue_t, setCallbackDispatchQueue, callbackDispatchQueue); +MCO_OBJC_SYNTHESIZE_SCALAR(BOOL, bool, setShouldRunWhenCancelled, shouldRunWhenCancelled); - (void) cancel { -- cgit v1.2.3