PriceGroupListViewController.m 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //
  2. // PriceGroupListViewController.m
  3. // HMLG Scan Order
  4. //
  5. // Created by Rui Zhang on 8/25/22.
  6. // Copyright © 2022 United Software Applications, Inc. All rights reserved.
  7. //
  8. #import "PriceGroupListViewController.h"
  9. @interface PriceGroupListViewController ()
  10. @end
  11. @implementation PriceGroupListViewController
  12. //
  13. - (void)viewDidLoad {
  14. [super viewDidLoad];
  15. [[self navigationController] setNavigationBarHidden:false animated:NO];
  16. UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"back"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
  17. style:UIBarButtonItemStylePlain
  18. target:self
  19. action:@selector( onBackClick:)];
  20. // self.navigationController.navigationItem.leftBarButtonItem=closeButton;
  21. self.navigationItem.leftBarButtonItem = closeButton;
  22. }
  23. - (void)onBackClick:(UIButton *)sender {
  24. [self.navigationController popViewControllerAnimated:FALSE];
  25. }
  26. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  27. return self.pricelist.count;
  28. }
  29. //- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  30. // return 136.0f;
  31. //}
  32. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  33. {
  34. static NSString *MyIdentifier = @"Cell";
  35. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
  36. if (cell == nil)
  37. {
  38. cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
  39. reuseIdentifier:MyIdentifier];
  40. }
  41. // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
  42. cell.textLabel.text = self.pricelist[indexPath.row];
  43. return cell;
  44. }
  45. - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  46. if(self.returnValue)
  47. self.returnValue(indexPath.item);
  48. [[self navigationController]popViewControllerAnimated:true];
  49. // [self dismissViewControllerAnimated:TRUE completion:nil];
  50. }
  51. /*
  52. #pragma mark - Navigation
  53. // In a storyboard-based application, you will often want to do a little preparation before navigation
  54. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  55. // Get the new view controller using [segue destinationViewController].
  56. // Pass the selected object to the new view controller.
  57. }
  58. */
  59. @end