iphone - UITableView adding cells dynamically -
i have uitableview
in nib file , dynamically add content each of cells in tableview. there way this? have array of text display in tableview array of pictures.
you need implement uitableviewdatasource
protocol , override the
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath
and
- (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section
methods. want return length of array tableview:numberofrowsinsection:
method. in tableview:cellforrowatindexpath:
method create uitableviewcell
(dequeue 1 if available) , add uiview
s want hold data (i.e. uiimage, etc.). access data populate view using indexpath.row index array(s). make sense? sounds bit more complicated in practice.
Comments
Post a Comment