通知的使用步骤:创建通知、发送通知、移除通知
创建通知后,返回界面要及时销毁,否则在进入后会多次执行,创建和移除必须同时出现
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(maidanPay:) name:TopUpBlock object:nil];
}
-(void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self name:TopUpBlock object:nil];
}