swift - NSTableView alternative row colors with NSArrayController -


so i'm using nsarraycontroller nstableview , want show custom row color nsarraycontroller doesn't have objects.

normally without cocoa bindings can "cheat" numberofrows this:

var datastore = [person]()  func numberofrowsintableview(tableview: nstableview) -> int {     if datastore.count < 20 {         return 20     } else {         return datastore.count     } } 

and getting custom row colors...

func tableview(tableview: nstableview, didaddrowview rowview: nstablerowview, forrow row: int) {     if row % 2 == 0 { rowview.backgroundcolor = nscolor.bluecolor() }     else { rowview.backgroundcolor = nscolor.recolor() } } 

how can same effect empty table view cocoa bindings?

i don't know code mac app in ios app, can achieve need cellforrowatindexpath. did try it?


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -