tags:

views:

41

answers:

2

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
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
Check out Till's answer
Shaggy Frog
+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
i think you have given the perfect answer of the given question.Thanks a lot.
Ankit Vyas