2010-01-22 2 views

ответ

1

NSUserDefaults будет удобно хранить фрагменты данных.

Пример:

- (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]; 
} 

упорствует и загружает целое (ваш метод будет «SetString» и «stringForKey», проверьте документы.)

+0

спасибо JoePasq, я попробую – RAGOpoR

Смежные вопросы