NSTableView is very laggy while scrolling

In my OS X application that uses Core Data , my table scan is very slow while scrolling and I only have about 100 rows ... I use Cocoa bindings with NSArrayController to show my data in a table.

I have only one Entity with 13 attributes, but still viewing the table view / scroll is very backward.

Is there any general error / bad coding that causes this behavior? My cpu usage is around 85% while I scroll.

Anyone have any ideas why? I am using Xcode version 7.

UPDATE:

The tools look like this (I used it the first time): enter image description here

Update 2: Im using NSVisualEffectView and overriding allowVibrancy returns true, so I get tables of alternative row colors in the same way as in my other Github-Debter project

If I cut the main animation layer for my viewing, it helps a lot in scrolling, but my storyboard starts to do something wearable, and I can’t work well with the UI release.

+5
source share
1 answer

Without looking at the code of your UITableView delegate and data source pretty hard to find out the exact problem.

Some bad habits:

  • Loading data from CoreData from any of the UITableViewDataSource methods or when rendering a UITableViewCell .
  • Uploading images to the main stream or downloading images in the background without caching them in local storage.
  • Perform complex operations (such as image processing) on tableViewCellForIndexPath or other data source methods.

Some questions that may help you find the problem:

  • Are you NSFetchedResultsController ? If your data set is long (although you are not talking about that), this can improve performance.
  • Have you checked the number of threads? If it is too high, you can use NSOperationQueue to limit background tasks.
+1
source

All Articles