Saving the game state when pressing the Home button
Hi! I'm porting a PocketPC game that makes use of the EDGELIB library to the iPhone (my first experience with a Mac platform). In PocketPC, the user can switch to another application and, when clicking again on its icon, the application restores itself automatically. Is there a similar thing on iPhone? Or should I write myself all the code that saves the application state before exiting?
Thanks in advance for your answers,
--Nacho
Thanks in advance for your answers,
--Nacho
You have to write your state saving code yourself. There is a system in place to make that easy to do though, called NSUserDefaults.
[adding] Register for UIApplicationWillTerminateNotification so you can be notified when to save your state.
[adding] Register for UIApplicationWillTerminateNotification so you can be notified when to save your state.
Or implement applicationWillTerminate: in your application delegate class.
Hi! Sorry for my late reply.
Since I'm using the EDGELIB library, I think that all those things you mention are wrapped under the library's framework. Nonetheless, I've found out that the method OnExit gets called whenever the user presses the Home button, so I've placed my call to the save function in there.
Thanks for all your help!
--Nacho
Since I'm using the EDGELIB library, I think that all those things you mention are wrapped under the library's framework. Nonetheless, I've found out that the method OnExit gets called whenever the user presses the Home button, so I've placed my call to the save function in there.
Thanks for all your help!
--Nacho
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Game State Management | Mattonaise | 6 | 6,197 |
Apr 16, 2011 10:18 AM Last Post: Mattonaise |
|
| Saving context | markhula | 4 | 5,429 |
Mar 8, 2011 02:37 AM Last Post: markhula |
|
| How do you create enums for state charts in ObjC? | riruilo | 7 | 5,846 |
Mar 27, 2010 11:50 PM Last Post: AnotherJake |
|
| Increase skill level button | dunhill68 | 12 | 4,575 |
Jan 8, 2010 02:57 PM Last Post: dunhill68 |
|
| Taking Pictures of Game State inside an app | Bersaelor | 7 | 4,634 |
Nov 3, 2009 05:07 AM Last Post: Bersaelor |
|

