tags:

views:

42

answers:

1

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
thanks JoePasq , i will try
RAGOpoR