简体   繁体   中英

Updating iPhone app removed the older version data

I am developing a social application for iOS using Objective-c. But when I published the newer version of my app and upgraded it using App Store, all of my older application data has been removed while every thing in both versions is the same like Bundle Identifier, Provisioning Profile, Signing Certificate. But I am confused why some thing like that happened. I was wondering if anyone could help me. This is too important for me, because this problem forces users to register again in the application.

update: I save data in the documents and also using core data

It might not be cleared just the path of the files changed, for example lets say you save the path of a photo like this :

/data/Containers/Data/Application/B42FE84A-E031-4A2C-AEA7-8D77AEAA389C/Documents/Photo.jpg

when you update the app the path will look like this because iOS will change app documents folder

/data/Containers/Data/Application/757455E1-355B-4040-8ABB-85F39D650A1E/Documents/Photo.jpg

so the file still exist but the path have changed and since you are saving the path the app won't find it because it was changed

i recommend saving only file name not the whole path

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM