Reputation: 3291
I am developing an application of iphone which is navigation based, and i am showing data on first View Items then on second View Sub Items and so on. So my question is that what will good approach to save this on Data base (sqlite).
Upvotes: 0
Views: 74
Reputation: 8383
i am not an expert in this field but you can do it like this ... now that you said all you data can be represented something like tree...
Find all the objects that will be leaf of your tree make those objects as a table in DB, (please keep in mind that you make table only for objects that have different structure not because they have different values)
Repeat above step for one level above until you reach top
Eventually you will find that you just got your DB.
To be more precise you need to study DBMS
Upvotes: 0
Reputation: 5393
Keep this simple. Each object/View has it's own ID and at least one parent ID. This will ensure your data can represent trees of any depth and any complexity.
Upvotes: 1