在很多时候我们都需要及时的对响应结果做出处理
通知的使用很简单:
发送通知
[[NSNotificationCenterdefaultCenter] postNotificationName:@"Success"object:niluserInfo:nil];
接收通知的监听:[[NSNotificationCenterdefaultCenter] addObserver:selfselector:@selector(alipaySuccess:)name:@"Success"object:nil];
有时候如果在同一个页面需要发送多次相同的通知,需要在类的析构函数里面移除监听.否则会出现接受多次通知.
[[NSNotificationCenterdefaultCenter]removeObserver:selfname:@"Success"object:nil];