我已經從在應用程序/文件夾的用戶存儲圖像的應用程序,我做了下面的代碼確定路徑保存它:使用目錄來存儲信息,並保持這些信息在應用程序更新
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docs = [paths objectAtIndex:0];
NSString *imageFilename = [[[[NSNumber alloc] initWithInteger:self.nextID] stringValue] stringByAppendingFormat:@".jpg"];
NSString *dirPath = [docs stringByAppendingFormat:@"/Photos/"];
imagePath = [dirPath stringByAppendingString:imageFilename];
它給了我類似(在模擬器)的路徑: /var/mobile/Applications/C9C43CFD-6A5F-40CF-8BAE-20496B5A544A/Documents/Photos/1.jpg
我保存這個路徑當我需要時顯示此圖像。
我的問題是,當我在應用程序商店發送更新時,更新應用程序後,它不能再顯示圖像。 我的理解是當更新AppStore中的應用程序時,Documents文件夾不能更改。
我可能的原因是它的應用程序文件夾和Documentar之間的名稱已更改,從AppStore更新應用程序版本時它是真的嗎?
有沒有人有任何想法?有什麼辦法來測試這個應用程序更新本地?
感謝