I’m looking for some technical guidance, perhaps a tutorial.
I’m having to cater for a lot more rows / cells in a table view that I had anticipated.
I already have the view / screen developed / released, however its slow if theres a lot of records, which hasn’t been the case until this upcoming release.
I think I’ll need to use limit / offset with my sqlite query, however I have sections in my table etc.
I’m also going to have to create a cell / row where users tap to say, show the next 50 records.
This must be quite a common issue, which must have been discussed before.
My issue is the time it will take to develop this feature. I’m too far into the project to convert to core data
Maybe Core Data could be a valid solution. If you use a
NSfetchedResultController(with itsNSFetchRequest) linked with aUITableView, items are managed for you.But if you don’t want to use Core Data, here a simple suggestion on how to do that:
Load in the model a bunch of data (say the first 50 items). Once loaded, the model is used to present data on the table. When the user reach the end of the table, I show a “Show more” label in the footer section for that table view. Then if the user click on it, load again data (other 50 items), cache them in the model and reload the table, and so on.
This trick can be applied if you have one section and multiple rows.
Hope it helps.
EDIT
If you don’t want to use Core Data I’ll do the following (some guidelines).
Using LIMIT SQL statement to limit the number of results (e.g. 20).
In your .h create an offset variable like:
and a method like:
Then in .m, implement that method like the following:
With the returning array update eac time the model.