Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-28-2010, 03:39 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 10
hanumandev is on a distinguished road
Default where to store images

I have an sqlite table that has 3 image fields (thumb, med, large) for 500 records. where is the best place to store these images?

seems strange to put 1500 images (3 images for each record) in the resoures folder.

also, I don't want to store them on an external server because the user needs to be able to access the records w/ images if they don't have a network connection.

thanks in advance for any help.
hanumandev is offline   Reply With Quote
Old 09-13-2010, 05:04 AM   #2 (permalink)
Registered Member
 
Join Date: Jul 2010
Location: UK, North East
Posts: 227
zardon is on a distinguished road
Default

Quote:
Originally Posted by hanumandev View Post
I have an sqlite table that has 3 image fields (thumb, med, large) for 500 records. where is the best place to store these images?

seems strange to put 1500 images (3 images for each record) in the resoures folder.

also, I don't want to store them on an external server because the user needs to be able to access the records w/ images if they don't have a network connection.

thanks in advance for any help.
Some of the basic tutorials say use BLOBs to store images; but from my background as a web developer says this is wrong because if the db gets corrupted or something you have no backup.

I would either put the images on the phone; or perhaps put the resources online and then use a JSON request to pull them in? But it does mean the user needs to be online to use the app.

Another alternative would be to use PAK the files up, but I do not know if this is possible, reasonable or not.
zardon is offline   Reply With Quote
Old 09-15-2010, 04:44 AM   #3 (permalink)
Gary B.
 
Join Date: Aug 2010
Location: Redding
Posts: 2
GWB104 is on a distinguished road
Default

[quote=hanumandev;239050]I have an sqlite table that has 3 image fields (thumb, med, large) for 500 records. where is the best place to store these images?

Store the images as PNG files in separate folders in the resource folder (thumb, med, large folders)... the SDK and the IOS uses the PNG format the most efficiently. Have the db reference the image from the folders. Also when moving the images to the project select "copy" otherwise the image is just a reference to the original.
GWB104 is offline   Reply With Quote
Old 09-15-2010, 05:09 AM   #4 (permalink)
Registered Member
 
Join Date: Oct 2009
Location: Amsterdam, The Netherlands
Posts: 782
TUX2K is on a distinguished road
Default

I would not suggest use PNG, the files will get very large just use JPG.
Also folder in the resource directory are not used on the phone, all the files in the resource directory just get copied in the bundle.
Be sure to have unique names for all the files.

I would just download the image when the user is about to view them, then store then (cache) in the documents directory.
There is a nice class for this in the 20three library called TTUrlChache.

Last edited by TUX2K; 09-15-2010 at 05:10 AM. Reason: Typos
TUX2K is offline   Reply With Quote
Reply

Bookmarks

Tags
images, iphone, resources, sqlite

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 340
6 members and 334 guests
dre, freewind, hain, HemiMG, lendo, Newbie123
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,894
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:59 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0