Weitere ähnliche Inhalte
Ähnlich wie Ruby/RubyCocoa for iPhone - UICoderz4 (18)
Ruby/RubyCocoa for iPhone - UICoderz4
- 83. class
Fuga
<
OSX::UIView
def
initialize
@tv
=
OSX::UITableView.alloc.initWithFrame(OSX::UIScreen.
mainScreen.bounds)
@tv.setValue_forKey(self,
"delegate")
@tv.setValue_forKey(self,
"dataSource")
self.addSubview(@tv)
end
def
tableView_numberOfRowsInSection(tableView,
section)
return
10
end
def
tableView_cellForRowAtIndexPath(tableView,
indexPath)
cellIdentifier
=
"Cell"
cell
=
tableView.dequeueReusableCellWithIdentifier(cellIdentifier)
if
(cell
==
nil)
then
cell
=
OSX::UITableViewCell.alloc.initWithFrame_reuseIdentifier(
[0,0,0,0],
cellIdentifier)
end
cell.setValue_forKey(indexPath.row.to_s,
"text")
cell
end
end
#
thnaks
to
@hitoriblog