Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
- static NSString *CellIdentifier = @"Cell";
- preferredCustomCell *mycell = (preferredCustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- UIView *backgroundView = [[UIView alloc] initWithFrame:mycell.selectedBackgroundView.frame];
- [backgroundView setBackgroundColor:[UIColor colorWithRed:189/255.f green:189/255.f blue:189/255.f alpha:0.25]];
- [mycell setSelectedBackgroundView:backgroundView];
- SearchbackView.hidden = YES;
- // Configure the cell...
- if (mycell == nil) {
- mycell = [[preferredCustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
- }
- MyData *dealerData = Nil;
- if (tableView == self.searchDisplayController.searchResultsTableView) {
- dealerData = [searchResults objectAtIndex:indexPath.row];
- } else {
- dealerData = [cellData objectAtIndex:indexPath.row];
- }
- dealerInfo = [NSString stringWithFormat:@"%@n%@n%@%@%@%@%@n%@n%@", dealerData.businessName, dealerData.address, dealerData.city,@", ", dealerData.state, @", ", dealerData.zip, dealerData.phone, dealerData.email]; // data.address;
- mycell.dealerInfoLbl.text = dealerInfo;
- mycell.dealerInfoLbl.numberOfLines = 0;
- mycell.selectDealerBtn.tag = indexPath.row;
- // Assign our own background image for the cell
- UIImage *background = [UIImage imageNamed:@"selectedCell"];
- UIImageView *cellBackgroundView = [[UIImageView alloc] initWithImage:background];
- cellBackgroundView.image = background;
- mycell.selectedBackgroundView = cellBackgroundView;
- mycell.lblPreferred.hidden = YES;
- if (mycell.selectDealerBtn.tag==btnTag) {
- if (selectDealer==true) {
- [mycell.selectDealerBtn setImage:[UIImage imageNamed:@"selectedDealer"] forState:UIControlStateNormal];
- [mycell.selectDealerBtn setTitle:@"Select" forState:UIControlStateNormal];
- mycell.selectDealerBtn.imageEdgeInsets = UIEdgeInsetsMake(6, 16, 26, 17);
- mycell.selectDealerBtn.titleEdgeInsets = UIEdgeInsetsMake(32,-66, 0, 10);
- mycell.lblPreferred.hidden = NO;
- }
- }
- else{
- [mycell.selectDealerBtn setImage:[UIImage imageNamed:@"N99-selectDealerBtn"] forState:UIControlStateNormal];
- [mycell.selectDealerBtn setTitle:@" " forState:UIControlStateNormal];
- mycell.lblPreferred.hidden = YES;
- }
- return mycell;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement