Guest User

Untitled

a guest
Jun 26th, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. MyBidsTableCell *cell;
  2.  
  3. NSArray *nibPath = [[NSBundle mainBundle] loadNibNamed:@"MyBidsTableCell" owner:self options:nil];
  4. cell = [nibPath objectAtIndex:0];
  5. [cell.myBidsProductImage setImageWithURL:[[itemsToCollect objectAtIndex:indexPath.row - 1] valueForKey:@"aucThumbnailUrl"]];
  6. cell.myBidsProductTitle.text =[[itemsToCollect objectAtIndex:indexPath.row - 1] valueForKey:@"aucTitle"];
  7. cell.myBidsProductPrice.text = [NSString stringWithFormat:@"$%.02f",[[[itemsToCollect objectAtIndex:indexPath.row - 1] valueForKey:@"aucCurrentBid"] floatValue]];
  8.  
  9. @try {
  10. NSString *strDate = [[itemsToCollect objectAtIndex:indexPath.row - 1] valueForKey:@"aucClose"];
  11. strDate = [strDate stringByReplacingOccurrencesOfString:@"T" withString:@" "];
  12. NSDateFormatter *oldFormat = [[NSDateFormatter alloc] init];
  13. // live format "2014-12-31T20:15:00"
  14. [oldFormat setDateFormat:@"yyyy-MM-dd kk:mm:ss"];
  15. NSDate *date = [oldFormat dateFromString:strDate];
  16. //dd/MM/yyyy h:mm:ss a == 31/12/2014 20:15:00 a
  17. NSDateFormatter *newFormat = [[NSDateFormatter alloc] init];
  18. [newFormat setDateFormat:@"dd/MM/yyyy h:mm:ss a"];
  19. NSString *newDate = [newFormat stringFromDate:date];
  20. NSLog(@"New Date - %@", newDate);
  21. cell.myBidsProductDate.text = newDate;
  22. }
  23. @catch (NSException * e) {
  24. NSLog(@"Exception: %@", e);
  25. }
  26.  
  27. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  28. return cell;
Advertisement
Add Comment
Please, Sign In to add comment