Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mraheel

macrumors regular
Original poster
Apr 18, 2009
136
0
Hey guys,

I wanted approach suggestions regarding an extra custom storage format.

Basically I got an app with an SQLite Db within bundle, im not copying it to the documents folder.
The db has got a table with 3 columns

1- RoadName (varchar)
2- Distance (integer)
3- Unit (varchar)

With the following entries:

Ox Street | 20 | miles
Fox Street | 32 | KM.

These are built in the app sqlite db and non editable, hence I didnt copy the db itself into the documents folder, BUT i want to develop an alternative "custom" storage system but Only for Distance and Unit part.

Heres the scenario, Launching the app, the table shows Road : Ox street, Fox Street,. on tapping one, it shows the detailView as -
Ox Street , 20 miles away.
this is filled by its class object - Road. where

Road.name = @"Ox Street";
Road.distance = 20;
Road.unit = @"miles";


I want the user to be able to change the "20" and "miles" and edit it to his needs.
Now, After I edit those values to for example
Road.distance = 5;
Road.unit = @"km";

What should be my Saving them and retrieving them, Should i save it to an XML in the documents folder? or another DB? or a pList?

Im looking for an efficient way to do this.. cuz not every entry will require this to be saved if the user choses to go default (values from the local DB).

Would it be useful if i created "Distance" &"Unit" into another individual class object?

Im super confused, Im aiming for efficiency here that doesnt compromise the speed of the detailView which, as it is, is bloated with value retrievals! from a db and a plist.

any suggestion is welcome :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.