Skip to content

Instantly share code, notes, and snippets.

@phynet
Created September 14, 2015 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phynet/a34c2bc207e6050f43ca to your computer and use it in GitHub Desktop.
Save phynet/a34c2bc207e6050f43ca to your computer and use it in GitHub Desktop.
Using NSNotification to update data
__typeof__(self) __weak wself = self;
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationWillEnterForegroundNotification object:nil queue:nil usingBlock:^(NSNotification *note) {
[wself updateData];
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment