warning clean up

This commit is contained in:
Pfeil, Scott Robert 2019-03-14 11:24:00 -04:00
parent 09938cfbf5
commit 3c7f647316
6 changed files with 29 additions and 25 deletions

View File

@ -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 <MVMCoreTopAlertDelegateProtocol> *)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 <MVMCoreAlertDelegateProtocol> *)actionDelegate;
}
return alert;
}

View File

@ -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;
});
}

View File

@ -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;
});
}

View File

@ -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;
}
});
}

View File

@ -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;
}

View File

@ -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"];
}