iosbackgrounddidreceivememorywarning

iphone killing background apps


Is there a way to kill background apps?

I have an app that I am working on that records a sound and then plots it out on a scroll view the problem I had with it is it crashes if the recording is too long because it runs out of memory trying to plot it. My fix to this is to monitor the amount of free memory and predict how much memory usage plotting will take and stop the recording just before there is not enough. The problem with that is the more apps I have running in the background the sooner it stops recording instead of killing background apps to make space the way that ios does before a didRecieveMemoryWarning. To restate my Question how can I kill these background apps? Will Apple frown upon this?


Solution

  • You want to kill other background apps programmatically from your foreground app? I suspect Apple would frown on that.

    In theory you can get their process id's from sysctl and send them a SIGKILL to terminate them, but iOS won't let you get info about other processes unless you are root (which means jailbreaking).