Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. //
  2. // ProductionShiftTableViewCellController_iPhone.m
  3. // OEETracker
  4. //
  5. // Created by Jeffrey Jackson on 7/5/11.
  6. // Copyright 2011 AutoLean, Inc. All rights reserved.
  7. //
  8.  
  9. #import "ProductionShiftTableViewCellController_iPhone.h"
  10.  
  11.  
  12. @implementation ProductionShiftTableViewCellController_iPhone
  13. @synthesize strShift;
  14. @synthesize segShift;
  15.  
  16. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  17. {
  18. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  19. if (self) {
  20. segShift.selectedSegmentIndex = -1;
  21. [self addObserver:self forKeyPath:@"strShift" options:0 context:NULL];
  22. }
  23. return self;
  24. }
  25.  
  26. - (void)setSelected:(BOOL)selected animated:(BOOL)animated
  27. {
  28. [super setSelected:selected animated:animated];
  29.  
  30. // Configure the view for the selected state
  31. }
  32.  
  33. - (IBAction)setSelectedShift
  34. {
  35. switch ([segShift selectedSegmentIndex])
  36. {
  37. case 0:
  38. [self setValue:@"1" forKey:@"strShift"];
  39. break;
  40. case 1:
  41. [self setValue:@"2" forKey:@"strShift"];
  42. break;
  43. case 2:
  44. [self setValue:@"3" forKey:@"strShift"];
  45. break;
  46. case 3:
  47. [self setValue:@"A" forKey:@"strShift"];
  48. break;
  49. case 4:
  50. [self setValue:@"B" forKey:@"strShift"];
  51. break;
  52. case 5:
  53. [self setValue:@"C" forKey:@"strShift"];
  54. break;
  55. case 6:
  56. [self setValue:@"D" forKey:@"strShift"];
  57. break;
  58. default:
  59. break;
  60. }
  61.  
  62. }
  63.  
  64. - (void)dealloc
  65. {
  66. [segShift release];
  67. [super dealloc];
  68. }
  69.  
  70. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement