0

I am experiencing a problem with switching app from background to foreground.

It is a tab bar based app. If i launch the app immediately it redirects to the view controller where i left off. but if I launch it after 5/10 min(basically after some period). It launches the app from initial screen.

From google, I read that if my app is in background for a while, it will be killed from by the Operating system based on the need of RAM for other application.

1. is this the only reason for the above problem or any other reasons ?

jailani
  • 2,260
  • 2
  • 21
  • 45
  • https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/PreservingandRestoringState.html#//apple_ref/doc/uid/TP40007457-CH28-SW5 – Paulw11 Mar 17 '16 at 09:18

1 Answers1

0

This is the main reason it can happen. You can maybe increase the time this takes to happen by implementing the didReceiveMemoryWarning method and adding sufficient code to free() / release a lot of resources that can be later recreated. This will give you a chance of not getting killed in some cases and maybe buy you some time.

DaKnOb
  • 577
  • 4
  • 17