5

I'm using UIApplication's openURL: method to open a website in Safari. When the user came back to the app (fast switching), it relaunched. It means that my app was quit instead of going to the background.

Does anyone have the same issue? Any ideas? Thank you in advance.

nonamelive
  • 6,510
  • 8
  • 40
  • 47
  • Not really a "crash". It really depends on if you app is set up to handle going into the background or not, also what device is being used, how much memory browsing in Safari ends up taking and how much memory you app needs. – Simon Goldeen Apr 25 '11 at 04:17

2 Answers2

5

It may be possible that you need to retain the URL object. That was once the issue for me

Tomen
  • 4,854
  • 5
  • 28
  • 39
  • YES!! This is the problem!! Thank you so much for this. I have to retain the NSURL object, or the app crashes. – nonamelive May 25 '11 at 06:10
  • I've noticed the same thing when using facebook login, the view I had up before the fast switching crashed because the data (model object) wasn't around anymore. But still doesn't it feel like something is a bit off? I mean we have to put a manual retain in there that has no release to go along with it? – pulkitsinghal Jan 26 '12 at 17:09
  • Thanks for this answer. This was a problem to me for about 2 weeks. – Fabio Poloni Jul 05 '12 at 16:35
0

make sure that you are using

- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

in your appdelegate rather than

- (void)applicationDidFinishLaunching:(UIApplication *)application
Rajat Talwar
  • 11,922
  • 1
  • 18
  • 12
  • I'm pretty sure that I'm using - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions, but still no luck. – nonamelive Apr 25 '11 at 06:08
  • are you using some heavy computation in aplicationWillenterbackground or some other functions which are called when application enters background.? remove them and then check. – Rajat Talwar May 12 '11 at 11:55