简体   繁体   English

使用iPhone SDK管理可能巨大的照片库的最佳方法

[英]Best way to manage probably huge photo library with iPhone SDK

I'm developing a app with a list of products. 我正在开发带有产品列表的应用程序。 I wanna let the user have 1 picture for each products. 我想让用户为每个产品有1张图片。

Now, the problem is what to do next. 现在,问题是下一步该怎么做。 I think that the best way is that the photos get sync when the user connect to their computer & itunes, and acces them from the app (something like: /photos/catalog/ref1.jpg . 我认为最好的方法是,当用户连接到计算机和iTunes并从应用程序访问照片时,照片会同步(例如: /photos/catalog/ref1.jpg

The other option is put them on my sqlite database, but I worry that that get bigger. 另一个选择是将它们放在我的sqlite数据库中,但是我担心它会变得更大。 I have data + picture, data change a lot but pictures are rarely modified (if much, I expect the user take 2-3 new pictures each time). 我有数据+图片,数据变化很多,但是图片很少修改(如果太多,我希望用户每次拍摄2-3张新图片)。

I would just use the network connection available on the device, and not bother with sync through iTunes. 我只会使用设备上可用的网络连接,而不会通过iTunes进行同步。

When you download the images, write them to the apps Documents folder, then load them from there. 下载图像时,将它们写入应用程序的Documents文件夹,然后从那里加载它们。 Network usage vs. disk space will be concern. 将关注网络使用率与磁盘空间的关系。 Keep in mind some carrier networks can be crazy expensive for data transfer. 请记住,某些运营商网络的数据传输费用可能非常高昂。

If the images are named with a systematic format, then you can maintain them by comparing the image identifiers against your data, pruning out the older or irrelevant ones. 如果图像是用系统格式命名的,则可以通过将图像标识符与数据进行比较,删除较旧或不相关的标识符来维护它们。

Do the math and ballpark just how much disk space you think it would take for a local copy of all the images. 算一下,您认为所有映像的本地副本将占用多少磁盘空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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