0

As per my query from the below link, i've implemented retrieving photo album images from ALAsset Library.

Upload ALAsset URL images to the server

I get the images Asset URL's like below, "assets-library://asset/asset.JPG?id=1000000001&ext=JPG" "assets-library://asset/asset.JPG?id=1000000002&ext=JPG" "assets-library://asset/asset.JPG?id=1000000003&ext=JPG"

I want to store these in a database (or) file [I don't know which is suitable for comparison for later purposes]. Next time(say,after 30 mins), i want to get again all the image URL's from Asset and compare with the previous image URL's which has stored in a DB, to find if any new images has been added in photo album or not. If any new image is been added in photo album, then i get that image in my code.

I want to know, what should i use to store the image URL strings, whether SQLite database (or) file, and next time which one should be sufficient to compare the previous data and the current data? I thought of going with creating sqlite database and store the data and compare the image URL strings with the stored data like that …. Am i thinking right to go? If yes, may i know how to store the data(image URL strings) in a sqlite database and do comparison between new image URL's and stored data? I created a sqlite database through Firefox sqlite manager plugin and added a table. I'm not getting any samples further to go through to solve my purposes, i.e. store the image URL strings in sqlite database and do comparison between the stored image URL strings and new image URL strings which i got from Asset library.

Please help and advise.

Thank you!

Community
  • 1
  • 1
Getsy
  • 4,887
  • 16
  • 78
  • 139

2 Answers2

0

yes you are going right. Use sqlite database to store URLs follow the tutorial

http://dblog.com.au/iphone-development-tutorials/iphone-sdk-tutorial-reading-data-from-a-sqlite-database/

saadnib
  • 11,145
  • 2
  • 33
  • 54
  • I want to learn how to store the image URL strings in a sqlite database and do comparison etc. I don't find any tutorials yet. What i see the link(dblog.com.au/..) is very basic which i already know and not helping for my purposes. – Getsy Mar 27 '11 at 19:06
0

Edit..sorry, i missed the last comment that explains what you want to do..

Here

http://developer.apple.com/library/ios/#documentation/DataManagement/Conceptual/iPhoneCoreData01/Introduction/Introduction.html

do that tutorial to learn how to set up the database and core data, you'll see how they save information - and from there just change code to suit your needs

Edit again.. after that you can use predicates to pull out info you need, and/or use string comparisons (Google "iPhone sdk compare strings") to compare to a new string.

or create an array of existing URL's and do something like

if ([myArrayOfURLS containsObject:theNewUrl]) {
       [self doSomethingWithMyNewURLIGuess];
}
mrburns05
  • 189
  • 1
  • 7