I'm working on an app that needs to run through a protocol from beginning to end. How do I force the app to always start at the beginning when brought back from the background, regardless of where it was left. Thanks
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How can I add media attachments to my push notific
write your application starting code in
applicationDidBecomeActive
method, because this method calls both time when you start your application first time & also when you cames from backgroundOne option is to use
exit()
. However, that method is only useful for testing/programming purposes. Apple will not accept that being in your code.Another option would be to create a global session similar to the method used by most social media API's, and in your App Delegate's:
set the global session to closed. Then just set your protocol logic to restart if the session is closed.
I hope that helps!
If your goal is to restart the app from scratch at every start up, simply add/change the key
UIApplicationExitsOnSuspend
toYES
in your info.plist fileHere's the relevant link in the documentation http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html