objective c - iPhone dev - Having problems adding text to cells of a UITableView -



objective c - iPhone dev - Having problems adding text to cells of a UITableView -

i trying create app display bunch of different people's names , address in different cells of uitableview. first i'm trying hand of adding text cells, , it's not working. have next code, mytableviewcontroller subclass of uitableviewcontroller loads in view nib (without drastic customizations):

mytableviewcontroller * tvc = [[mytableviewcontroller alloc] initwithstyle:uitableviewstyleplain]; nsindexpath *path1 =[nsindexpath indexpathforrow:0 insection:0]; nsindexpath *path2 =[nsindexpath indexpathforrow:1 insection:0]; [self presentmodalviewcontroller:tvc animated:yes]; uitableviewcell * cell1 = [tvc.tableview cellforrowatindexpath:path1]; uitableviewcell * cell2 = [tvc.tableview cellforrowatindexpath:path2]; cell1.textlabel.text = @"test"; cell2.textlabel.text = @"test2";

i expecting see tableview animate onto screen, followed first , sec cells beingness filled text "test" , "test2" respectively. blank tableview animating onto screen. if scroll downwards top cell hidden , scroll top cell 1 time again visible, top cell have text "test" in it. sec cell downwards never shows text, top one.

can please point me in right direction? have text in tableview before loads onto screen, looks cells don't exist unless beingness displayed. please help me.

populating table view takes form of data-source pattern, table view calls info source object info set in individual cells.

try reading through table view programming guide.

iphone objective-c uitableview

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -