0

i have noticed that my ipad application remains in previous state (state when i closed the app) when it coming from background. i have checked the plist and delegate methods fro this problem. actually i have a web app that uses UIWebView . i cant figure out wot the actual problem is. i dont want my app to work in background and it should start from the initial each time it opens.

is this problem related to cache memory? do we need to delete the cache memory when the app closes?

need some help

neerajPK
  • 293
  • 1
  • 4
  • 17
  • 1
    Is your application entirely stateless? I'd find any application that started from square one each time I opened it incredibly frustrating given that I move between iMessage/Mail/Safari/ on my iDevice with some regularity. And by "incredibly frustrating" I mean deleted. – ta.speot.is Jul 24 '12 at 11:46

3 Answers3

2

Try adding this to the Info.plist file.

UIApplicationExitsOnSuspend=YES

As a boolean value. It does not allow the application to run in background.

Neo
  • 936
  • 6
  • 17
2

In fact users expect apps to return to the place where they left it. On iOS there's no real (user) distinction between apps that in memory but not in the foreground and apps that have exited.

Having said that, there are two ways of doing what you want:

  1. Try adding the UIApplicationExitsOnSuspend flag to your Info.plist
  2. Reset your UI either in the send to background or bring to foreground notifications
Stephen Darlington
  • 51,577
  • 12
  • 107
  • 152
1

OKAY, SORRY.. I FOUND THE SOLUTION MYSELF.

i just put this field "application does not run on background" on info.plist

now the application will start from its initial state each time it opens.

thank you,

neerajPK
  • 293
  • 1
  • 4
  • 17
  • It is the xcode name of the key UIApplicationExitsOnSuspend. Have a look to [here](https://developer.apple.com/library/mac/#documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW1) for details. ;) – Neo Jul 24 '12 at 11:48