diff --git a/MVMCore/MVMCore/AlertHandling/MVMCoreAlertObject.m b/MVMCore/MVMCore/AlertHandling/MVMCoreAlertObject.m index 0a5d8ca..8c37cbf 100644 --- a/MVMCore/MVMCore/AlertHandling/MVMCoreAlertObject.m +++ b/MVMCore/MVMCore/AlertHandling/MVMCoreAlertObject.m @@ -63,7 +63,9 @@ if ([messageStyle isEqualToString:ValueMessageStyleTopPersistent] || [messageStyle isEqualToString:ValueMessageStyleTop]) { alert.topAlertObject = [[MVMCoreTopAlertObject alloc] initWithResponseInfo:responseInfo]; - alert.topAlertObject.delegate = actionDelegate; + if ([actionDelegate conformsToProtocol:@protocol(MVMCoreTopAlertDelegateProtocol)]) { + alert.topAlertObject.delegate = (NSObject *)actionDelegate; + } alert.topAlertObject.pageType = pageType; alert.type = MFAlertTypeTop; } else if ([messageStyle isEqualToString:ValueMessageStylePopup]) { @@ -99,7 +101,9 @@ alert.alertStyle = UIAlertControllerStyleAlert; } } - alert.alertDelegate = actionDelegate; + if ([actionDelegate conformsToProtocol:@protocol(MVMCoreAlertDelegateProtocol)]) { + alert.alertDelegate = (NSObject *)actionDelegate; + } return alert; } diff --git a/MVMCore/MVMCore/AlertHandling/MVMCoreAlertOperation.m b/MVMCore/MVMCore/AlertHandling/MVMCoreAlertOperation.m index 1a2901f..9e9d35f 100644 --- a/MVMCore/MVMCore/AlertHandling/MVMCoreAlertOperation.m +++ b/MVMCore/MVMCore/AlertHandling/MVMCoreAlertOperation.m @@ -83,28 +83,28 @@ static void * XXContext = &XXContext; - (BOOL)isPaused { __block BOOL isPaused; dispatch_sync(self.pausedQueue, ^{ - isPaused = _paused; + isPaused = self->_paused; }); return isPaused; } - (void)setPaused:(BOOL)paused { dispatch_barrier_async(self.pausedQueue, ^{ - _paused = paused; + self->_paused = paused; }); } - (BOOL)isDisplayed { __block BOOL isDisplayed; dispatch_sync(self.displayedQueue, ^{ - isDisplayed = _displayed; + isDisplayed = self->_displayed; }); return isDisplayed; } - (void)setDisplayed:(BOOL)displayed { dispatch_barrier_async(self.displayedQueue, ^{ - _displayed = displayed; + self->_displayed = displayed; }); } diff --git a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertOperation.m b/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertOperation.m index 222a56e..50f296c 100644 --- a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertOperation.m +++ b/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertOperation.m @@ -56,42 +56,42 @@ - (BOOL)isPaused { __block BOOL isPaused; dispatch_sync(self.pausedQueue, ^{ - isPaused = _paused; + isPaused = self->_paused; }); return isPaused; } - (void)setPaused:(BOOL)paused { dispatch_barrier_async(self.pausedQueue, ^{ - _paused = paused; + self->_paused = paused; }); } - (BOOL)isDisplayed { __block BOOL isDisplayed; dispatch_sync(self.displayedQueue, ^{ - isDisplayed = _displayed; + isDisplayed = self->_displayed; }); return isDisplayed; } - (void)setDisplayed:(BOOL)displayed { dispatch_barrier_async(self.displayedQueue, ^{ - _displayed = displayed; + self->_displayed = displayed; }); } - (BOOL)isAnimating { __block BOOL isAnimating; dispatch_sync(self.animatingQueue, ^{ - isAnimating = _animating; + isAnimating = self->_animating; }); return isAnimating; } - (void)setAnimating:(BOOL)animating { dispatch_barrier_async(self.animatingQueue, ^{ - _animating = animating; + self->_animating = animating; }); } diff --git a/MVMCore/MVMCore/LoadHandling/FreeBee/MFFreebeeHandler.m b/MVMCore/MVMCore/LoadHandling/FreeBee/MFFreebeeHandler.m index ef3a0fa..d4a1621 100644 --- a/MVMCore/MVMCore/LoadHandling/FreeBee/MFFreebeeHandler.m +++ b/MVMCore/MVMCore/LoadHandling/FreeBee/MFFreebeeHandler.m @@ -611,14 +611,14 @@ typedef NS_ENUM(NSUInteger, FreeBeeCampaignState) { dispatch_async(dispatch_get_main_queue(), ^{ if (enable) { - _reachability = [Reachability reachabilityForInternetConnection]; + self->_reachability = [Reachability reachabilityForInternetConnection]; // Observe the kNetworkReachabilityChangedNotification. When that notification is posted, the method reachabilityChanged will be called. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityDidChange:) name:kReachabilityChangedNotification object:nil]; - [_reachability startNotifier]; - } else if (_reachability) { + [self->_reachability startNotifier]; + } else if (self->_reachability) { [[NSNotificationCenter defaultCenter] removeObserver:self name:kReachabilityChangedNotification object:nil]; - [_reachability stopNotifier]; - _reachability = nil; + [self->_reachability stopNotifier]; + self->_reachability = nil; } }); } diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m b/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m index cc6a666..73428c4 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m @@ -67,7 +67,7 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt"; // Filled with pages that we do not want to cache on client side. static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - _pageTypesToNotCache = [NSMutableSet set]; + self->_pageTypesToNotCache = [NSMutableSet set]; }); return _pageTypesToNotCache; } @@ -77,7 +77,7 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt"; // Filled with modules that we do not want to cache on client side. static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - _modulesToNotCache = [NSMutableSet set]; + self->_modulesToNotCache = [NSMutableSet set]; }); return _modulesToNotCache; } @@ -382,7 +382,7 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt"; // Create in memory cache static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - _imgCache = [[NSMutableDictionary alloc] init]; + self->_imgCache = [[NSMutableDictionary alloc] init]; }); return _imgCache; } diff --git a/MVMCore/MVMCore/Utility/MVMCoreOperation.m b/MVMCore/MVMCore/Utility/MVMCoreOperation.m index 139a8c1..bf7bc7e 100644 --- a/MVMCore/MVMCore/Utility/MVMCoreOperation.m +++ b/MVMCore/MVMCore/Utility/MVMCoreOperation.m @@ -44,7 +44,7 @@ - (BOOL)isExecuting { __block BOOL isExecuting; dispatch_sync(self.executingQueue, ^{ - isExecuting = executing; + isExecuting = self->executing; }); return isExecuting; } @@ -52,7 +52,7 @@ - (BOOL)isFinished { __block BOOL isFinished; dispatch_sync(self.finishedQueue, ^{ - isFinished = finished; + isFinished = self->finished; }); return isFinished; } @@ -73,14 +73,14 @@ if ([self isExecuting]) { [self willChangeValueForKey:@"isExecuting"]; dispatch_barrier_async(self.executingQueue, ^{ - executing = NO; + self->executing = NO; }); [self didChangeValueForKey:@"isExecuting"]; } if (![self isFinished]) { [self willChangeValueForKey:@"isFinished"]; dispatch_barrier_async(self.finishedQueue, ^{ - finished = YES; + self->finished = YES; }); [self didChangeValueForKey:@"isFinished"]; } @@ -97,7 +97,7 @@ if (![self isExecuting]) { [self willChangeValueForKey:@"isExecuting"]; dispatch_barrier_async(self.executingQueue, ^{ - executing = YES; + self->executing = YES; }); [self didChangeValueForKey:@"isExecuting"]; }