通知页面:
[[NSNotificationCenter defaultCenter] postNotificationName:@"Notification_GetUserProfileSuccess" object:self userInfo:nil];
执行通知页面:
销毁通知
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"Notification_GetUserProfileSuccess" object:nil];
}
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getUserProfileSuccess:) name:@"Notification_GetUserProfileSuccess" object:nil];
- (void) getUserProfileSuccess: (NSNotification*) aNotification
{
self.tableView.frame = CGRectMake(0, -20, SCREEN_WIDTH, SCREEN_HEIGHT + 20);
}
NSNotification *notification =[NSNotification notificationWithName:@"CHANGEROOTVC" object:nil userInfo:@{@"type":@"1"}];
//通过通知中心发送通知54
[[NSNotificationCenter defaultCenter] postNotification:notification];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(tongzhi:) name:@"CHANGEROOTVC" object:nil];
- (void)tongzhi:(NSNotification *)text{
if ([text.userInfo[@"type"] integerValue] == 1) {
RootTabBarController *tab = [[RootTabBarController alloc] init];
self.window.rootViewController =tab;
}
}