Could you give me some algorithm or example?
+1
A:
NSUserDefaults
will nicely hold onto snippets of data.
Example:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[window addSubview:tabBarController.view];
if ([[NSUserDefaults standardUserDefaults] integerForKey:kTabIndexKey])
tabBarController.selectedIndex = [[NSUserDefaults standardUserDefaults] integerForKey:kTabIndexKey];
}
- (void)applicationWillTerminate:(UIApplication *)application {
[[NSUserDefaults standardUserDefaults] setInteger:tabBarController.selectedIndex forKey:kTabIndexKey];
}
Persists and loads an integer (your method would be "setString" and "stringForKey", check the docs.)
JoePasq
2010-01-22 02:17:42
thanks JoePasq , i will try
RAGOpoR
2010-01-22 08:38:58