注册:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector()name:UIApplicationDidBecomeActiveNotification object:nil];
取消:
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotificationobject:nil];