开发者

Is it possible to delete a file from my iOS app's bundle?

I currently have a large .sqlite data store of long string te开发者_开发百科xt. It's about 160MB and will grow to about 200MB when I'm completely done. This is a "read only" data set.

What I do now is simply place that file in my bundle and read it during runtime. However, that means the app requires you to download 160MB. Not optimal.

One solution is to gzip that file, ship the gzipped version in the bundle, uncompress it on first run, and put it in the Documents/ folder. This means you'd download far less, but the total size the app uses on the device is (size of gzip'd + size of ungzip'd) which is obviously not optimal either.

I want to use the gzip solution, but after application's first run, I want to delete the .gz version. Is this possible? How do I achieve it? What would another good solution be?


It is not possible to delete a file in the bundle. The app must be signed and if the bundle is modified in any way, it will not pass the signature.

The only other solution I can think of, is to setup a web service, and have your app download portions of your content as necessary. This may or may not be a viable solution, depending on what your app is actually doing.


As Paul says, anything in your bundle is part of the signature. I can't see this changing as it is a fundamental part of signing apps.

The other classic approach is to compress the data in your bundle, as heavily as possible, so you unpack it when you build the working storage.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜