0
몇 가지 알고리즘이나 예제를 제공해 주시겠습니까?iPhone에서 텍스트 데이터를 캐시하는 방법에 대한 조언이 필요합니다.
몇 가지 알고리즘이나 예제를 제공해 주시겠습니까?iPhone에서 텍스트 데이터를 캐시하는 방법에 대한 조언이 필요합니다.
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];
}
가 지속 및 정수
JoePasq에게 감사드립니다. – RAGOpoR
는 "캐시"무엇을 의미합니까 (당신의 방법은 "setString 등"과 "stringForKey", 워드 프로세서를 확인을 할 것이다.)로드? "지속"한다는 뜻입니까? – gerry3