Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  2.  
  3. static NSString *MyIdentifier = @"MyIdentifier";
  4. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
  5. if (cell == nil)
  6. {
  7. cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier];
  8. }
  9.  
  10. // Set up the cell
  11. int storyIndex = [indexPath indexAtPosition: [indexPath length] - 1];
  12. NSString *temp = [[NSString alloc] initWithString:[[stories objectAtIndex: storyIndex] objectForKey: @"title"]];
  13. cell.textLabel.text = temp;
  14. [[cell textLabel] setTextColor:[UIColor colorWithRed:154.0/255.0 green:14.0/255.0 blue:2.0/255.0 alpha:1]];
  15. [[cell textLabel] setFont:[UIFont systemFontOfSize:12.0]];
  16.  
  17. return cell;
  18. }
  19.  
  20. - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
  21. }
  22.  
  23. -(UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  24. static NSString *cellString = @"cell";
  25. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellString];
  26. if(cell == nil){
  27. cell = [[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:cellString];
  28. }
  29. cell.textLabel.text = values;
  30. cell.textLabel.textColor = [UIColor colorWithRed:154.0/255.0 green:14.0/255.0 blue:2.0/255.0 alpha:1];
  31. cell.textLabel.font = [UIFont systemFontOfSize:12.0];
  32. return cell;
  33. }
  34.  
  35. cell.textLabel.font = [UIFont systemFontOfSize:12.0];
  36. cell.detailTextLabel.font = [UIFont systemFontOfSize:10.0];
  37.  
  38. - (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
  39. {
  40.  
  41. cell.textLabel.textColor = [UIColor grayColor]; //redColor greenColor etc.
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement