"[[UIApplication sharedApplication] openURL:url]" - Can't Open more than two to four URLs without killing my app

StackOverflow https://stackoverflow.com/questions/20737234

Question

I am using [[UIApplication sharedApplication] openURL:url] to open social media URLs in an app. However, I can't seem to open more than two to four URLs before my app gets killed (app ended unexpectedly). I also notice that when I call the above mentioned method, my memory usage is jumping significantly (I was hoping this would not be the case).

I tried to open the exact same URLs from mail.app, and I can keep opening the URLs without mail.app being killed. So definitely something is wrong with my app.

Question 1: Any input on how can I avoid increasing memory usage when I call [[UIApplication sharedApplication] openURL:url].

Question 2: Why is mail.app not getting killed, while my app is killed?

Many thanks!

Was it helpful?

Solution

Upon researching another question on stack overflow and following suggestion to remove NSLog (not many of them in my app), things seem to work just fine and my app is not getting killed. I am logging this for any future reference for other readers. If you're getting a message that your app is killed due to MEMORY PRESSURE, try removing NSLog from the app and see if that helps. It helped me! Here is the reference to the other thread: link

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