Monday 15 September 2014

osx - NSTableview View Based Scrolling Performance -



osx - NSTableview View Based Scrolling Performance -

i new os x cocoa programming have decided give go new swift language.

i have nstableview 1500 rows (will more) , 7 columns. there 1 checkbox column , rest text fields, 1 date formate , 1 currency formatter. first set cell based. scrolling buttery smooth (i did test adding 1 1000000 rows, still smooth). under mavericks.

i upgraded yosemite, scrolling performance degraded. enabling core animation layer checkbox on table view improved still worse in mavericks.

during reading trying improve scroll performance in yosemite came across "view-based" nstableviews. documentation said cell based table views should not used , supported legacy projects.

i hence converted table view based table view. sample simple concept, nil complicated. scrolling performance absolutely terrible. if scroll slow smooth plenty start scroll faster hasn't buffered plenty , starts stuttering , jerking. when nstableview populated, focusing , defocusing window takes sec or more (i tried in mavericks 1 time again , not present, scrolling little better, still near cell based).

are view based nstableviews bad scrolling performance? if why apple recommend using them on cell based nstableviews.

also applications safari , reeder2 have buttery smooth scrolling in yosemite. how accomplish this?

am missing or performance of os x going hell each new thing? i.e

mavericks > yosemite

cell-based > view-based

old > new

any help much appreciated. thanks!

according apple, osx never enable quartzcore default (as ios, instead, do). so, need to:

link against quartzcore.framework project under build settings pane. enable coreanimation layer (under view effects inspector on ib) main window (if possible, otherwise sure enable on container view give poor performances).

quoting apple docs:

in ios apps, core animation enabled , every view backed layer. in os x, apps must explicitly enable core animation back upwards doing following:

link against quartzcore framework. (ios apps must link against framework if utilize core animation interfaces explicitly.) enable layer back upwards 1 or more of nsview objects doing 1 of following:

in nib files, utilize view effects inspector enable layer back upwards views. inspector displays checkboxes selected view , subviews. recommended enable layer back upwards in content view of window whenever possible. views create programmatically, phone call view’s setwantslayer: method , pass value of yes indicate view should utilize layers. enabling layer back upwards in 1 of preceding ways creates layer-backed view. layer-backed view, scheme takes responsibility creating underlying layer object , keeping layer updated. in os x, possible create layer-hosting view, whereby app creates , manages underlying layer object. (you cannot create layer-hosting views in ios.) more info on how create layer-hosting view, see “layer hosting lets alter layer object in os x.”

more on: https://developer.apple.com/library/ios/documentation/cocoa/conceptual/coreanimation_guide/settinguplayerobjects/settinguplayerobjects.html

osx cocoa swift scroll nstableview

No comments:

Post a Comment