Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MyBidsTableCell *cell;
- NSArray *nibPath = [[NSBundle mainBundle] loadNibNamed:@"MyBidsTableCell" owner:self options:nil];
- cell = [nibPath objectAtIndex:0];
- [cell.myBidsProductImage setImageWithURL:[[itemsToCollect objectAtIndex:indexPath.row - 1] valueForKey:@"aucThumbnailUrl"]];
- cell.myBidsProductTitle.text =[[itemsToCollect objectAtIndex:indexPath.row - 1] valueForKey:@"aucTitle"];
- cell.myBidsProductPrice.text = [NSString stringWithFormat:@"$%.02f",[[[itemsToCollect objectAtIndex:indexPath.row - 1] valueForKey:@"aucCurrentBid"] floatValue]];
- @try {
- NSString *strDate = [[itemsToCollect objectAtIndex:indexPath.row - 1] valueForKey:@"aucClose"];
- strDate = [strDate stringByReplacingOccurrencesOfString:@"T" withString:@" "];
- NSDateFormatter *oldFormat = [[NSDateFormatter alloc] init];
- // live format "2014-12-31T20:15:00"
- [oldFormat setDateFormat:@"yyyy-MM-dd kk:mm:ss"];
- NSDate *date = [oldFormat dateFromString:strDate];
- //dd/MM/yyyy h:mm:ss a == 31/12/2014 20:15:00 a
- NSDateFormatter *newFormat = [[NSDateFormatter alloc] init];
- [newFormat setDateFormat:@"dd/MM/yyyy h:mm:ss a"];
- NSString *newDate = [newFormat stringFromDate:date];
- NSLog(@"New Date - %@", newDate);
- cell.myBidsProductDate.text = newDate;
- }
- @catch (NSException * e) {
- NSLog(@"Exception: %@", e);
- }
- [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
- return cell;
Advertisement
Add Comment
Please, Sign In to add comment