Populating a UITableView from arrays

前端 未结 3 2008
臣服心动
臣服心动 2021-02-11 02:31

I need help with the following code i am using hpple to parse html. and i need help utilizing the data.

-(void) whatever{
NSData *htmlData = [[NSString stringWit         


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-11 02:56

    First you have to set UITableViewDelegate and UITableViewDatasource in .h file where you are creating tableview and declare an NSarray to store the table values,and in .m file of viedidload function you need to intialise the array with objects (arr_name=[NSArray alloc]initwith Objects:@"one",@"two",nil) and you have to place these three methods

    • (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    • (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

    • (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

提交回复
热议问题