走开页面,撤销资源,

- (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;

    }

}

posted @ 2013-10-28 14:28  路在脚下,  阅读(162)  评论(0编辑  收藏  举报