开发者

Refresh tableview on enterforeground

I have a tab bar application with five views. I need to refresh the second view when the app returns from background, but only if the user was before 开发者_JAVA技巧in that view.

I tried :

- (id)init
{
    self = [super init];
    if (self) {
        [[NSNotificationCenter defaultCenter] addObserver:self 
                                                 selector:@selector(reloadThisView:) 
                                                     name:UIApplicationWillEnterForegroundNotification 
                                                   object:nil];
        // Do some more stuff
    }
    return self;
}

- (void)reloadThisView:(NSNotification *)notification
{
    [self getAllLista];
}

But I don't use and don't know how to use init in this case at all…

Any suggestions?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜