(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
NSInteger rowTest;
rowTest = [pickerView selectedRowInComponent:0];
NSString *inStr = [NSString stringWithFormat: @"%ld", (long)rowTest];
testPickSelectNew = [NSString stringWithFormat: @"%ld", (long)rowTest];
NSArray *checkAuctionVCR = [VehicleData valueForKey:@"AuctionVCR.AuctionVCR"];
if ([testPickSelectNew isEqual: @"1"])
{
[self removePicker];
self.locationPersonDate.text = [dataArray objectAtIndex:row];
[self.vcrDamagesTable reloadData];
[self calculateTotalLabels];
eventAddress = @"";
self.locationPersonDate.text = @"";
[self loadEventInfo];
// _vcrDamagesTable.dataSource = nil;
}
else if ([testPickSelectNew isEqual: @"2"])
{
[self removePicker];
self.locationPersonDate.text = [dataArray objectAtIndex:row];
[self.vcrDamagesTable reloadData];
[self calculateTotalLabels];
eventAddress = @"";
self.locationPersonDate.text = @"";
[self loadEventInfo];
// _vcrDamagesTable.dataSource = nil;
}
}
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (tableView == self.vcrDamagesTable)
{
VCRCell *vcrCell = [tableView dequeueReusableCellWithIdentifier:vcrDamagesTableViewCellIdentifier];
if (!vcrCell) vcrCell = [[VCRCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:vcrDamagesTableViewCellIdentifier];
if (!(indexPath.row [VehicleData vcrDamageItems].count)) return [UITableViewCell new];
NSDictionary *vcrDamageData = [VehicleData vcrDamageItems][indexPath.row];
// Hacking the existing method to cache additional images for VCR by creating a new VIN
vcrCell.cellVIN = [[VehicleData vin] stringByAppendingString:[NSNumber numberWithInteger:indexPath.row].stringValue];
vcrCell.imageURL = [NSURL URLWithString:vcrDamageData[@"PhotoURL"]];
[vcrCell.damagePhoto setImage:nil];
[vcrCell.damagePhoto loadVehicleImageForVIN:vcrCell.cellVIN imageURL:vcrCell.imageURL];
[vcrCell.damagePhoto setBackgroundColor:(vcrCell.imageURL.path.length? [UIColor colorWithWhite:0.75 alpha:0.5] : [UIColor clearColor])];
vcrCell.damageItem.text = vcrDamageData[@"DamageItem"];
vcrCell.damageDescription.text = vcrDamageData[@"Description"];
vcrCell.partsCost.text = [vcrDamageData[@"Parts"] currency];
vcrCell.laborCost.text = [vcrDamageData[@"Labor"] currency];
vcrCell.laborHours.text = vcrDamageData[@"Hours"];
vcrCell.estimate.text = [vcrDamageData[@"Estimate"] currency]; [vcrCell setBackgroundColor:[UIColor colorWithWhite:1.00f alpha:0.50f]];
vcrCell.delegate = self;
return vcrCell;
}
return [UITableViewCell new];
}
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: