图来源于官方。
Inactive:The app is running in the foreground but is currently not receiving events. An app usually stays in this state only briefly as it transitions to a different state.
Background:Most apps enter this state briefly on their way to being suspended.”
对应的几个状态函数分别是:
application:willFinishLaunchingWithOptions:
application:didFinishLaunchingWithOptions:一般的初始化工作安排在这。
applicationDidEnterBackground: Use this method to release shared resources, invalidate timers, and store enough app state information to restore your app to its current state in case it is terminated later.
applicationWillEnterForeground: This method is called as part of the transition from the background to the active state.The call to this method is invariably followed by a call to the applicationDidBecomeActive: method.
applicationWillTerminate:This method is not called if your app is suspended。运行在Background状态时这个delegate才会被调用。处在suspended状态的app在系统内存不足时会直接被系统回收。