i have used segment control for distance measuring in km or Miles so if i select any option from both and application will terminate and when i start application it should show the lastly used value.
A:
Before the O/S terminates your app, it will call the applicationWillTerminate:
method in your application delegate. If you're asking a more general question -- how to save any information in case of abnormal program exit -- there's no perfect answer for that, and you'll have to give us more context.
Shaggy Frog
2010-04-20 04:51:03
i want to show value which was last pressed in the segment Control before my application terminates and when i start then it shows me last pressed segment controls value.
Ankit Vyas
2010-04-20 04:57:38
Check out Till's answer
Shaggy Frog
2010-04-20 05:01:10
+1
A:
Several options:
- (the right way) Use NSUserDefaults as drafted in this tutorial
- (simple but custom solution) Use a custom plist-file included within your application bundle as drafted in this tutorial
- (bit bloated for such simple case) Use CoreData for persitant storage of your objects / data
Till
2010-04-20 04:59:09
i think you have given the perfect answer of the given question.Thanks a lot.
Ankit Vyas
2010-04-20 05:16:39