views:

31

answers:

2

Hi,

I have 100s of file which needs to be accessed for displaying the content on iphone. They are all plists.

Which one is faster core data or file access ? which one is secured ?

+1  A: 

You have to consider the file size first, a nice rule of thumb found in these boards is, if the file is under 100kB you can store it as an attribute in an entity as a BLOB, if it is greater that that you maybe want to create a ad-hoc entity for it, and in the end if it exceeds 1 MB in size you can access it through the filesystem.

Secondly, you shall evaluate the cost of the operation too, 100 files may appear many but if you access them few times, maybe file access is the way to go, on the other hand if you need that stored information multiple times frequently but you can even create ad hoc entities for Core Data and load the files at start up. And so on.

This is a nice book on Core Data. You can find many guide lines by reading it, but keep in mind also the general guide lines of designing databases.

rano
A: 

If they are static files I would recommend pre-loading them into a Core Data SQLite file. That would yield far better performance, especially if you structure your model properly.

Marcus S. Zarra