开发者

IOS: set all classes at nil when app go in background

开发者 https://www.devze.com 2023-04-11 15:08 出处:网络
In my app, everytime it go in background I want set all classes at nil, then, when I call the app a second time, it seems that 开发者_如何学CI call it at first time. Is it possible?Making absolutely a

In my app, everytime it go in background I want set all classes at nil, then, when I call the app a second time, it seems that 开发者_如何学CI call it at first time. Is it possible?


Making absolutely all classes to nil will make your app unusable when it comes back from background. If what you are trying to accomplish is to make your app non-multitasking then read this: http://maniacdev.com/2010/07/screw-multi-tasking-how-to-make-your-ios-4-apps-exit-for-real/


What you could do is disable background Multitasking for your app altogether and that would mean it would start up like it's been started fresh each time you open it.

To do this, in your Info.plist, add a new Row with the following parameters:

  • The name should be Application does not run in background (If it's showing Keys then the key is UIApplicationExitsOnSuspend)
  • The type should be Boolean
  • The value should be YES
0

精彩评论

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