Hi
Prior to 4.0, my playerprefs worked perfectly. For example, if the player set sound “off” in the app then closed the app, the next time the app is opened it would show the sound as ‘off’ and the user could switch it back on and the music would kick in without dramas.
Now that 4.0 is here, the above isn’t occurring. Yes, the sound button works fine if the game goes into a suspended state i.e. just closing it down. If you reopen it takes off from where it left off from it’s ‘paused’ state.
However, if I close the app, then remove the app from the suspended apps menu (double tap Home button to reveal), and then open the app to start from scratch, NO player prefs have been saved.
Also, now I’m finding that if I delete the app from the suspended menu on bottom screen, and then try to launch the app from main screen, the app crashes at the point where playerprefs were originally set in Scene 1. (function Update() code as follows to see if playerprefs set or not, as when we go into Scene 2, the sound button needs to know what state the music is in to display the correct on or off texture).
if (!PlayerPrefs.HasKey("Sound"))
{
PlayerPrefs.SetString("Sound", "On");
}
BUT this crash ONLY occurs if I had changed the setting of sound in the app first before closing and removing its suspended icon from the bottom screen. If I DON’T change the original setting (On state), and remove the icon bottom screen, then the app doesn’t crash on re-launch.
My architecture is Standard (armv 6, armv7)
Base SDK 4.0
Unity 1.7
Valid architecture armv6, armv7
Deployment iPhone only
iPhone OS Deployment Target iPhone OS 3.1.3 (changing this to 4.0 makes no difference, so would rather support devices still on 3.1.3 for the time being)
I’m Building to an iPhone 3GS running latest 4.01 OS.
Is the above setup correct? Any advice or other people’s experiences like this? This is doing my head in ><