Populating a UITableView from arrays

前端 未结 3 2010
臣服心动
臣服心动 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:52

        - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return [titles count];
    
    }
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    
    
            static NSString *MyIdentifier = @"MyIdentifier";
    
            UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
            if (cell == nil){
                cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease];
            }
    
    
        cell.textLabel.text = [titles objectAtIndex:indexPath.row];
    
            return cell;
    
    }
    
    
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    /* here pop up Your subview with corresponding  value  from the array with array index indexpath.row ..*/
    
    }
    

提交回复
热议问题