tags:

views:

23

answers:

1

My question in the previous post was-

I have a cocos2d game, and after I exit the game and start it again, it starts at the exact same point it was before closing.why this is happening??and not only this, my game is landscapemode but when i start it again from simulator it comes in potrait mode,not it landscapemode like first time.

Is there any way to prevent this?

Anyone will come to rescue me???

I found a solution.Is it good??

when i exit the game(by pressing the back button in iPhone simulator) this problem occurred.Now i found that if i press back button the following function is called-

(void)applicationWillResignActive:(UIApplication *)application 

So i set (divide by zero) or something like this in -(void)applicationWillResignActive funtion so that when this function called the application crashes.Then if i restart the application everything comes from beginning(reset) which i want.Is it good solution or anything better??

*my applicationDidFinishLaunching was not called again when application is restart from simulator.

A: 

You should configure the Info.plist to indicate that you does not want your application run in Background.

The key is

UIApplicationExitsOnSuspend

If you need more detail you should look at this tutorial

F.Santoni