Slow loading of UITableView. How know why?


Slow loading of UITableView. How know why?



I have a UITableView that show a long list of data. Use sections and follow the sugestion of http://stackoverflow.com/questions/695814/how-solve-slow-scrolling-in-uitableview .

The flow is load a main UITableView & push a second selecting a row from there.

However, with 3000 items take 11 seconds to show. I suspect first from the load of the records from sqlite (I preload the first 200). So I cut it to only 50.

However, no matter if I preload only 1 or 500, the time is the same.

The view is made from IB and all is opaque.

I run out of ideas in how detect the problem. I run the Instruments tool but not know what to look.

Also, when the user select a cell from the previous UITable, no visual feedback is show (ie: the cell not turn selected) for a while so he thinks he not select it and try several times. Is related to this problem.

What to do?

NOTE: The problem is only in the actual device:

  • iPod Touch 2d generation
  • Using fmdb as sqlite api
  • Doing the caching in viewDidLoad
  • Using NSDictionary for the caching
  • Using a NSAutoreleasePool for the caching part.
  • Only caching the row ID & mac 4 fields necesary to show the cell data
  • UIView made with interface builder, SDK 2.2.1
  • Instruments say I use 2.5 MB in the device

Where to find a description of all the math functions like floorf and others?

1:

How to take these parameters the same way this function does?
The -[FMResultSet next] call must be a very expensive call to make, depending on the data that's receive ting loaded. error: property 'myBoolVariableName' with 'retain' attribute must be of object type It'd during this call this sqlite is actually going to the database, finding the next row to return, and giving you back the appropriate fields. does javascript on iphone mobile safari support xpath? It's not just an enumerator.. Passing NSInteger variable to NSMutableDictionary or NSMutableArray You might want to consider pre-caching all of the data before actually displaying the table. does removefromsuperview releases the objects of scrollview? This means this you would did all of your FMDB calls before the table receive s shown on the screen.. Renew Provisioning Profile If this takes too long, you might want to show the tableview with its initial rows, and then use NSOperations or just a second thread to load the data in the background and cache it this way.. [iPhone SDK] [Newbie] UITextView textViewDidChange will not be called?

2:

Without seeing any code, I think I would be inclined to think this you need to index you tables. . You should see an enormous speed up by adding an index on the attrialthough es you query on. You must did this by using the CREATE INDEX SQL command..


68 out of 100 based on 43 user ratings 1058 reviews