1
votes

I have a tableview where i need to show around 10,000 rows (data stored locally in sqlite)

But when we jump to that view, app is getting blocked (freezed) as its loading all those rows.

Is there anyway to load data without freezing UI?

PS. Our app is rejected, is it because of this reason?

Thanks

EDIT: They rejected and given following info "Hello.

We noticed your app lacks native iOS functionality.

Please check out the videos for app design information,: "Getting Started video: The Ingredients of Great iPhone Apps" and "iPhone User Interface Design," available on the iOS Developer Centerhttp://developer.apple.com/devcenter/ios, and the iOS Human Interface Guidelineshttp://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/MobileHIG.pdfin particular, the sections, "Great iOS Apps Embrace the Platform and HI Design Principles"http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/MobileHIG/Introduction/Introduction.htmland "Human Interface Principles"http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/MobileHIG/Principles/Principles.html%23//apple_ref/doc/uid/TP40006556-CH5-SW1."

2
When an app is rejected, they usually tell you a reason. - Phillip Mills
why don't you use Load More Concept...? First only show 25 Data. and When user scrolls down at that time load another 25 more data........ - Wolverine
@PhillipMills i have added reason above but basically they don't give clear reason - cnu

2 Answers

1
votes

With ten thousand rows you have no choice but load your data on demand. Otherwise, your app has no chance of performing at a decent level. A freeze like you describe would definitely be enough to see your app rejected1.

This approach is rather wasteful with memory, too, because out of ten thousand rows you need at most two dozen at any given time.

A reasonably simple way to speed things up is to prepare an NSCache for your pages of data (say, ten items per page), add code that gets the total count of records, and modify the code that retrieves the data to read records from a single page (use LIMIT/OFFSET). When your table shows rows, it should try getting a page of the row from the cache. If the page is not there, it should load it from sqlite, and put in the cache. Using pages will minimize the number of roundtrips to the database; using cache will let you manage an optimal use of memory.


1
0
votes

Check this demo for lazy loading of all data along with images.

This sample demonstrates a multi-stage approach to loading and displaying a UITableView. It begins by loading the relevant text from an RSS feed so the table can load as quickly as possible, and then downloads the images for each row asynchronously so the UI is more responsive.