-
-
Save gliubc/1871dd497c44686db2f04e9af1c0f0ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 监听通知 | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveCartDataChangedNotification:) name:@"CartDataChangedNotification" object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveAlipayResultNotification:) name:@"AlipayResultNotification" object:nil]; | |
- (void)dealloc { | |
[[NSNotificationCenter defaultCenter] removeObserver:self]; | |
} | |
/// 接收到购物车数据改变 | |
- (void)receiveCartDataChangedNotification:(NSNotification *)notification { | |
self.cartDataChanged = YES; | |
} | |
- (void)receiveAlipayResultNotification:(NSNotification *)notification { | |
[self handleAlipayResult:notification.userInfo]; | |
} | |
// 通知购物车数据已改变 | |
[[NSNotificationCenter defaultCenter] postNotificationName:@"CartDataChangedNotification" object:self]; | |
[[NSNotificationCenter defaultCenter] postNotificationName:@"AlipayResultNotification" object:self userInfo:resultDic]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment