Guest User

Untitled

a guest
Jul 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  2.  
  3. static NSString *myID = @"customCell";
  4. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:myID];
  5.  
  6. if(cell == NULL) {
  7.  
  8. [[NSBundle mainBundle] loadNibNamed:@"CustomCellView" owner:self options:nil];
  9.  
  10. cell = customCell;
  11. self.customCell = nil;
  12. }
  13.  
  14. Post *p = [posts objectAtIndex:indexPath.row];
  15.  
  16. UILabel *label = (UILabel*)[cell viewWithTag:15];
  17. label.text = p.Name;
  18.  
  19. label = (UILabel*)[cell viewWithTag:10];
  20. label.text = p.Text;
  21. [label sizeToFit];
  22.  
  23. label = (UILabel*)[cell viewWithTag:20];
  24. label.text = [p Source];
  25.  
  26. //[cell layoutSubviews];
  27.  
  28. return cell;
  29. }
  30.  
  31. [label setFrame:CGRectMake(0.0f, 0.0f, 100.0f, 50.0f)];
  32. [label sizeToFit];
Add Comment
Please, Sign In to add comment