Take the 2-minute tour ×

I'm debugging my app with the simulator. And for some moment in concrete situation the app gets mimimized. I think there is some problem in my code (Most likely some variable is not initialized, because sometimes everything works) . But how can I catch this moment.

In xcode is still written that the program is running and I can put breakpoints and the will trigger.

And if i will reopen my application it will continue working... When using device the are no problems too...

How can i catch this moment and pause the program to view a callstack.


I Think the problem is here: Objective-c singleton object does not working as expected

share|improve this question
To be clear, you think your app is being put in the background randomly? –  raidfive Feb 19 '11 at 22:11
@raidfive: No, it happens in a concrete situation sometimes. But it is hard to provide the code because it's big. The question is how can i stop the program when it's being minimized - so i can view a callstack –  Andrew Feb 19 '11 at 22:23
If it doesn't happen when debugging on the device, why not just leave it? –  Aurum Aquila Feb 19 '11 at 22:28
@Aurum: because a good program should work in every situation –  Andrew Feb 19 '11 at 22:32
I've never heard of this happening personally. I wasn't aware it was possible to background an app programmatically without user interaction. –  raidfive Feb 20 '11 at 0:34

1 Answer 1

up vote 0 down vote accepted

You could try catching it in the - (void)applicationDidEnterBackground:(UIApplication *)application-methode in the app delegate, at least then you will see specifically when it happens.

share|improve this answer
Thanks, i've already done it. I've found some problem and now trying to understand where does it come from –  Andrew Feb 19 '11 at 23:18

Your Answer


