Search code examples
iphoneobjective-cdatabasesqlitefmdb

How to rearrange items in FMDB?


I'm using FMDB in my project now

I can insert and delete my database , but how t o rearrange the items in FMDB ???

Now I turn the sqlite into a array with dictionaries .

And load the array to table view , than what should I do after I rearrange the tableview ???

Thanks for any reply or answer : )


Solution

  • It sounds like you need a way to remember the order of items in your database. If that's the case, you'll have to add an extra column (called something like "item_order") and use the table view methods for moving cells to update the database.

    Use the "item_order" to do the initial ordering when you first get the data to display.