1、带参数
//注册通知//方法实现
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updatCardInfo:) name:updateCardInfoNotification object:nil];
//方法实现
-(void) updatCardInfo :(NSNotification*) notification
{
接收参数 = [notification object]; //通过这个获取到传递的对象
}
//发送通知
[[NSNotificationCenter defaultCenter] postNotificationName:updateCardInfoNotification object:参数];
2、不带参数
//注册通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceDamage) name:VDBlueToothDamageNotification object:nil];
//方法实现
-(void)deviceDamage
{
}
//发送通知
[[NSNotificationCenter defaultCenter] postNotificationName:VDBlueToothDamageNotification object:nil];