Fixes warning: multiple methods named 'postNotificationName:object:' found [-Wstrict-selector-match]

This commit is contained in:
Oliver Jones 2013-01-30 11:22:15 +11:00 committed by Mattt Thompson
parent 74da4493f2
commit 6b8cdf1581
2 changed files with 7 additions and 4 deletions

View file

@ -304,7 +304,8 @@ static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused targ
} }
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:[NSDictionary dictionaryWithObject:[NSNumber numberWithInteger:status] forKey:AFNetworkingReachabilityNotificationStatusItem]]; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:[NSDictionary dictionaryWithObject:[NSNumber numberWithInteger:status] forKey:AFNetworkingReachabilityNotificationStatusItem]];
}); });
} }

View file

@ -341,12 +341,13 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
[self.lock unlock]; [self.lock unlock];
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
switch (state) { switch (state) {
case AFOperationExecutingState: case AFOperationExecutingState:
[[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingOperationDidStartNotification object:self]; [notificationCenter postNotificationName:AFNetworkingOperationDidStartNotification object:self];
break; break;
case AFOperationFinishedState: case AFOperationFinishedState:
[[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingOperationDidFinishNotification object:self]; [notificationCenter postNotificationName:AFNetworkingOperationDidFinishNotification object:self];
break; break;
default: default:
break; break;
@ -393,7 +394,8 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
[self.connection performSelector:@selector(cancel) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]]; [self.connection performSelector:@selector(cancel) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]];
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingOperationDidFinishNotification object:self]; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter postNotificationName:AFNetworkingOperationDidFinishNotification object:self];
}); });
} }