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 uiviews 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.

here documentation uitableviewdatasource protocol


Comments

Popular posts from this blog

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -

Python __call__ special method practical example -