- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
if (SharedAppDelegate.userInfo) {
self.userMenu.gender = SharedAppDelegate.userInfo.gender;
self.userMenu.dotImageView.hidden = !SharedAppDelegate.hasNewMsg;
self.beatTimer = [NSTimerscheduledTimerWithTimeInterval:kBeatIntervaltarget:selfselector:@selector(loadInteract) userInfo:nilrepeats:YES];
[self.beatTimer fire];
self.userMenu.hidden = NO;
}
else {
self.userMenu.hidden = YES;
}
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
if (self.beatTimer.isValid) {
[self.beatTimer invalidate];
self.beatTimer = nil;
}
}