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
Post a Comment