iPhone + NSUserDefault + NSString
<p>I am using the NSUsersDefault to save the state of application when there is any interruption in the app.</p>

<p>What I am doing is that I have created a method "saveState" in my class where the application is running and in this method I am saving all the necessary things in NSUsersDefault, among those things I have few NSString which I am saving like</p>

<p>[prefs setObject:batsman1HowOut forKey:@"batsman1HowOut"];</p>

<p>Now, I am calling "saveState" method from the AppDelegate class -> applicationWillTerminate method.</p>

<p>So, what happens is that when interruption will occur it will come to app delegate class and applicationWillTerminate method will be called and it will than go to the "saveState" method of the class where I am storing everything in NSUsersDefault.</p>

<p>Problem is that when I am trying to save the NSString (like the one above), it is giving me error saying that it is out of scope.</p>

<p>Please help me.</p>

<p>Regards,
Pratik</p>
