Question

I am running my application on iOS 7.0.1 & iPod Touch 5th generation device. When I follow below steps my app quits with below error on Xcode 5 without any error in console

App quit Unexpectedly Terminated due to Memory Pressure

Steps: 1) Run my application using Xcode 5. Login & then go to Home

2) Click on Home button so that my app enters in background (I can see my app is in background)

3) Start inbuilt Photos app from iOS. Click 1 or 2 pictures

4) After taking 1-2 pictures , App quit Unexpectedly Terminated due to Memory Pressure

I am not doing anything in my app. When I checked the CPU usage its 0% & Memeory used = 15.2 MB Also there is no other app running in the background except my app.

Can anybody help with this ? Thanks

I am not getting why this is happening. If I don't use Photos.app then app works smoothly.

Was it helpful?

Solution

There's nothing you can, or should, do about this. You application is no longer in the foreground, and the foreground app (photos) is asking for more memory. To supply this, iOS will terminate any apps running in the background. It doesn't matter how much memory your app is using, iOS will terminate background apps as long as the foreground app requires more memory.

Once your app enters the background you can expect it to be terminated at any time. To improve the user experience, you can look at Enabling State Preservation and Restoration in Your App. This in theory allows your app to start where it left off when the user comes back to it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top