Skip to content

Instantly share code, notes, and snippets.

@kei-q
Created June 9, 2012 09:29
Show Gist options
  • Select an option

  • Save kei-q/2900267 to your computer and use it in GitHub Desktop.

Select an option

Save kei-q/2900267 to your computer and use it in GitHub Desktop.
macruby tableview
class AppDelegate
attr_accessor :window
def initialize
@contents = [
{'name' => 'hoge', 'age' => '123'},
{'name' => 'fuga', 'age' => '456'}
]
end
def numberOfRowsInTableView(aTableView)
@contents.length
end
def tableView(aTableView, objectValueForTableColumn: aTableColumn, row: rowIndex)
row = @contents[rowIndex]
row[aTableColumn.identifier]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment