Advertisement
01010harshad_vaghela

Untitled

May 1st, 2013
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  2. {
  3.  
  4. static NSString *CellIdentifier = @"Cell";
  5.  
  6. cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  7. if (cell == nil)
  8. {
  9. cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
  10. }
  11.  
  12. cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
  13.  
  14.  
  15. cell.textLabel.font = [UIFont fontWithName:@"Helvetica" size:15];
  16.  
  17. cell.textLabel.text =[passarray objectAtIndex:indexPath.row];
  18.  
  19. if(indexPath.row ==1){
  20.  
  21. buybtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
  22. buybtn.frame = CGRectMake(90, 0 , 120, 44);
  23. buybtn.tag = indexPath.row;
  24. cell.selectionStyle=UITableViewCellSelectionStyleNone;
  25. buybtn.backgroundColor = [UIColor redColor];
  26. [buybtn setTitle:@"Buy" forState:UIControlStateNormal];
  27. [buybtn addTarget:self action:@selector(button1:) forControlEvents:UIControlEventTouchUpInside];
  28. [cell.contentView addSubview:buybtn];
  29.  
  30. [AVAudioPlayer instancesRespondToSelector:@selector(stopAudio:)];
  31.  
  32. }
  33. else
  34. {
  35. cell.userInteractionEnabled = YES;
  36. }
  37.  
  38.  
  39. /* if(indexPath.row ==1)
  40. {
  41.  
  42. buybtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
  43. buybtn.frame = CGRectMake(90, 0 , 120, 44);
  44. buybtn.tag = indexPath.row;
  45. // cell.selectionStyle=UITableViewCellSelectionStyleNone;
  46. buybtn.backgroundColor = [UIColor redColor];
  47. [buybtn setTitle:@"Buy" forState:UIControlStateNormal];
  48. [buybtn addTarget:self action:@selector(button1:) forControlEvents:UIControlEventTouchUpInside];
  49. [cell.contentView addSubview:buybtn];
  50.  
  51. }
  52. */
  53. return cell;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement