2013-06-10 3 views
1

https를 통해 서버에 연결하는 iOS phonegap 애플리케이션이 있습니다. (App_name)/Library/(BundleId) /Cache.db (cfurl_cache_response)에서 클라이언트가 삭제하려는 사용자에 대한 정보가 저장되었습니다. 저장 문제를 해결했지만 사용자가 응용 프로그램을 업데이트 할 때 cache.db에 저장된 저장된 정보를 삭제하려고합니다. 프로그래밍 방식으로 실현할 수 있습니까?cache.db 데이터를 지우거나 조작하는 방법 ios 애플리케이션

답변

4
BOOL isNotFirstTimeRun = [[NSUserDefaults standardUserDefaults] boolForKey:@"isnotfirsttimerun"]; 
if (!isNotFirstTimeRun) { 
    // Clear the cache if this is a first time run 
    [[NSURLCache sharedURLCache] removeAllCachedResponses]; 
    // Set the flag to true and synchronize the user defaults 
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 
    [defaults setBool:YES forKey: @"isnotfirsttimerun"]; 
    [defaults synchronize]; 
} 

didFinishLaunchingWithOptions에서 나를 위해 일해 줬습니다.

관련 문제