LoginSignup
13
14

More than 5 years have passed since last update.

アプリケーションがバックグラウンドから復帰するときに任意の処理を呼び出す

Posted at

NSNotificationCenterのaddObserver:selector:name:object:で呼び出したいselectorを登録すれば良いです。

UIApplication *application = [UIApplication sharedApplication];

// アクティブになったときに通知されるように登録する    
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(hoge) name:UIApplicationDidBecomeActiveNotification object:application];

UIApplicationDidBecomeActiveNotification以外にもいろいろあるみたいです。

参考
[iPhoneプログラミング]UIApplicationのNotificationsの一覧

13
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
14