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?
精彩评论