jansensan
jansensan

Reputation: 627

How to handle closing apps with multitasking with Objective C?

I have read some bits and pieces here and there about multitasking, but I am not sure I grasp it all. Basically, I have an iPhone app that runs quite ok on the iPhone simulator (I have yet to pay the dev fee to be able to deploy to an actual iPhone).

In the simulator, I can enter and exit the app, without issue. When I open the multitasking bar (double tap on the home button), I can close the app. When I try to reopen it, I then get an error.

I wonder, is this because testing closing and opening the app from multitasking is only possible on an actual iPhone, or are the some additional events I should be listening to? I have read this: http://www.cocos2d-iphone.org/forum/topic/8767 and added some handlers, but this article feels dated, and it didn't change anything.

Any help is appreciated!

Upvotes: 1

Views: 945

Answers (2)

Ali Hamze
Ali Hamze

Reputation: 1590

As Richard said, that is normal. If you want to test it yourself:

  1. Run the app using Xcode.
  2. Stop the app using Xcode. (Press the Stop button which is directly to the right of the run button.
  3. Launch the app by clicking on it in the Simulator's home screen.
  4. Close the app and then close it from the multitasking bar.
  5. Launch it again.

Good luck :)

Upvotes: 0

Richard J. Ross III
Richard J. Ross III

Reputation: 55563

The post about SIGKILL is correct. It is normal behavior for your application. Xcode is just reporting what killed your application the last time. Simply stop the execution and run your app again, and you should be fine.

Upvotes: 2

Related Questions