Guest User

Untitled

a guest
Jun 26th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. if (tableView.tag == 802) {
  2. if (indexPath.row == 0) {
  3. //MyAccCollectionCell
  4. if (IS_IPAD) {
  5. MyAccCollectioniPadCell *cell;
  6. NSArray *nibPath = [[NSBundle mainBundle] loadNibNamed:@"MyAccCollectioniPadCell" owner:self options:nil];
  7. cell = [nibPath objectAtIndex:0];
  8. cell.myAccBalanceListHeader.text = @" COLLECTION OUTSTANDING";
  9. //[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  10. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  11. return cell;
  12. }else{
  13. MyAccCollectionCell *cell;
  14. NSArray *nibPath = [[NSBundle mainBundle] loadNibNamed:@"MyAccCollectionCell" owner:self options:nil];
  15. cell = [nibPath objectAtIndex:0];
  16. cell.myAccBalanceListHeader.text = @" COLLECTION OUTSTANDING";
  17. //[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  18. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  19. return cell;
  20. }
  21. }else{
  22. MyAccTableItemsCell *cell = (MyAccTableItemsCell *)[tableView dequeueReusableCellWithIdentifier:@"cell"];
  23. NSArray *nibPath = [[NSBundle mainBundle] loadNibNamed:@"MyAccTableItemsCell" owner:self options:nil];
  24. cell = [nibPath objectAtIndex:0];
  25. [cell.myBidsProductImage setImageWithURL:[[itemsToCollect objectAtIndex:indexPath.row - 1] valueForKey:@"aucThumbnailUrl"]];
  26. cell.myBidsProductTitle.text =[[itemsToCollect objectAtIndex:indexPath.row - 1] valueForKey:@"aucTitle"];
  27. cell.myBidsProductPrice.text = [NSString stringWithFormat:@"$%.02f",[[[itemsToCollect objectAtIndex:indexPath.row - 1] valueForKey:@"aucCurrentBid"] floatValue]];
  28.  
  29. @try {
  30. NSString *strDate = [[itemsToCollect objectAtIndex:indexPath.row - 1] valueForKey:@"aucClose"];
  31. strDate = [strDate stringByReplacingOccurrencesOfString:@"T" withString:@" "];
  32. NSDateFormatter *oldFormat = [[NSDateFormatter alloc] init];
  33. // live format "2014-12-31T20:15:00"
  34. [oldFormat setDateFormat:@"yyyy-MM-dd kk:mm:ss"];
  35. NSDate *date = [oldFormat dateFromString:strDate];
  36. //dd/MM/yyyy h:mm:ss a == 31/12/2014 20:15:00 a
  37. NSDateFormatter *newFormat = [[NSDateFormatter alloc] init];
  38. [newFormat setDateFormat:@"dd/MM/yyyy h:mm:ss a"];
  39. NSString *newDate = [newFormat stringFromDate:date];
  40. NSLog(@"New Date - %@", newDate);
  41. cell.myBidsProductDate.text = newDate;
  42. }
  43. @catch (NSException * e) {
  44. NSLog(@"Exception: %@", e);
  45. }
  46.  
  47. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  48. return cell;
  49.  
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment