All pastes #2057030 Raw Edit

Someone

public text v1 · immutable
#2057030 ·published 2011-05-11 20:53 UTC
rendered paste body
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    NSInteger rows = [[self playersDict] count];
    return rows;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{  

    static NSString *cellIdentifier = @"MyCell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    if(cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:cellIdentifier] autorelease];
    }
    
    //cell.textLabel.text=@"foo";
    cell.textLabel.text=[[playersDict objectAtIndex:indexPath.row] objectForKey:@"alias"];
    //NSLog(@"value: %@", [[playersDict objectAtIndex:indexPath.row] objectForKey:@"value"]);
    //[NSNumber numberWithInteger:score.value] forKey:@"value"];
    NSString *foo = [[[playersDict objectAtIndex:indexPath.row] objectForKey:@"value"] stringValue];
    cell.detailTextLabel.text=foo;
    return cell;
}