Jelajahi Sumber

修复ERP Mobile 工程的部分警告错误

Ray Zhang 6 tahun lalu
induk
melakukan
392320b5b8
21 mengubah file dengan 116 tambahan dan 90 penghapusan
  1. 4 4
      RedAnt ERP Mobile/common/AppDelegateBase.m
  2. 27 8
      RedAnt ERP Mobile/common/CartUtils.m
  3. 3 3
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellAction.m
  4. 4 4
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellEnum.m
  5. 1 0
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellImg.m
  6. 3 3
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellLabel.m
  7. 16 13
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m
  8. 1 0
      RedAnt ERP Mobile/common/Functions/MainViewController.m
  9. 6 6
      RedAnt ERP Mobile/common/Functions/cart/CartGeneralNotesViewController.m
  10. 2 2
      RedAnt ERP Mobile/common/Functions/cart/CartViewController.m
  11. 6 6
      RedAnt ERP Mobile/common/Functions/cart/ItemNotesViewController.m
  12. 8 8
      RedAnt ERP Mobile/common/Functions/home/HomeTableViewCellBanner.m
  13. 10 10
      RedAnt ERP Mobile/common/Functions/home/HomeTableViewCellSlide.m
  14. 3 3
      RedAnt ERP Mobile/common/Functions/home/HomeTableViewCellTopic.m
  15. 1 1
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.h
  16. 1 0
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.m
  17. 1 1
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailTopicCell.m
  18. 6 6
      RedAnt ERP Mobile/common/Functions/modelDetail/ModelDescriptionController.m
  19. 1 0
      RedAnt ERP Mobile/common/Functions/order/RAOrderPreviewController.m
  20. 6 6
      RedAnt ERP Mobile/common/customUI/ImageScrollerViewController.m
  21. 6 6
      common/WK PDF+Web/RAPDFViewController.m

+ 4 - 4
RedAnt ERP Mobile/common/AppDelegateBase.m

@@ -2121,8 +2121,8 @@ void UncaughtExceptionHandler(NSException *exception) {
         //打开文件失败,通常是文件路径有问题或密码错误。
         
         return UNZIP_OPEN_FAILED;
-        NSFileManager *fileManager = [NSFileManager defaultManager];
-        [fileManager removeItemAtPath:zipFile error:nil];
+//        NSFileManager *fileManager = [NSFileManager defaultManager];
+//        [fileManager removeItemAtPath:zipFile error:nil];
     }
     // [zip release];
 }
@@ -3309,8 +3309,8 @@ void UncaughtExceptionHandler(NSException *exception) {
         
         
 #ifdef RA_NOTIFICATION
-        if((_eventsFeedback!=nil)&&([_eventsFeedback respondsToSelector:@selector(onLogUpdate)])){
-            [_eventsFeedback onLogUpdate];
+        if((self->_eventsFeedback!=nil)&&([self->_eventsFeedback respondsToSelector:@selector(onLogUpdate)])){
+            [self->_eventsFeedback onLogUpdate];
         }
 #else
         

+ 27 - 8
RedAnt ERP Mobile/common/CartUtils.m

@@ -18,7 +18,7 @@
 +(void) neworder:(UIViewController*) vc selectorholder:(id)holder selector:(SEL)addtocart
 {
 
-    UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Create Order"];
+    UIAlertController * waitalert = [RAUtils waiting_alert:vc title:@"Create Order"];
     [RANetwork request_create_order:^(NSMutableDictionary *result) {
         NSMutableDictionary* return_json = result;
         
@@ -37,8 +37,12 @@
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                 appDelegate.order_code = order_code;
                 appDelegate.order_status = [[return_json valueForKey:@"orderStatus"] intValue];
+                   
+                IMP imp = [holder methodForSelector:addtocart];
+                void (*func)(id, SEL) = (void *)imp;
+                func(holder, addtocart);
                 
-                [holder performSelector:addtocart];
+//                    [holder performSelector:addtocart];
                 
                 
                 
@@ -140,7 +144,10 @@
                         //ovc.customer_id = appDelegate.contact_id;
                         ovc.selectOrder = ^(NSMutableDictionary* order_detail){
 
-                            [holder performSelector:addtocart];
+                            IMP imp = [holder methodForSelector:addtocart];
+                            void (*func)(id, SEL) = (void *)imp;
+                            func(holder, addtocart);
+//                            [holder performSelector:addtocart];
 
 
                         };
@@ -294,7 +301,10 @@
                     //ovc.customer_id = appDelegate.contact_id;
                     ovc.selectOrder = ^(NSMutableDictionary* order_detail){
 
-                        [holder performSelector:addtocart];
+                        IMP imp = [holder methodForSelector:addtocart];
+                        void (*func)(id, SEL) = (void *)imp;
+                        func(holder, addtocart);
+//                        [holder performSelector:addtocart];
 
 
                     };
@@ -390,7 +400,7 @@
             else
             {
 
-                UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Checking Pending Order"];
+                UIAlertController * waitalert = [RAUtils waiting_alert:vc title:@"Checking Pending Order"];
 
 
                 [RANetwork request_pendingorder:appDelegate.contact_id completionHandler:^(NSMutableDictionary *result) {
@@ -430,7 +440,10 @@
                                 ovc.customer_id = appDelegate.contact_id;
                                 ovc.selectOrder = ^(NSMutableDictionary* order_detail){
                                     
-                                    [holder performSelector:addtocart];
+                                    IMP imp = [holder methodForSelector:addtocart];
+                                    void (*func)(id, SEL) = (void *)imp;
+                                    func(holder, addtocart);
+//                                    [holder performSelector:addtocart];
                                     
                                     
                                 };
@@ -548,7 +561,10 @@
                                     ovc.customer_id = appDelegate.contact_id;
                                     ovc.selectOrder = ^(NSMutableDictionary* order_detail){
                                         
-                                        [holder performSelector:addtocart];
+                                        IMP imp = [holder methodForSelector:addtocart];
+                                        void (*func)(id, SEL) = (void *)imp;
+                                        func(holder, addtocart);
+//                                        [holder performSelector:addtocart];
                                         
                                         
                                     };
@@ -1037,7 +1053,10 @@
             //            if(appDelegate.order_code==nil)
             //                [ self neworder];
             //            else
-            [holder performSelector:addtocart];
+            IMP imp = [holder methodForSelector:addtocart];
+            void (*func)(id, SEL) = (void *)imp;
+            func(holder, addtocart);
+//            [holder performSelector:addtocart];
 
 
 

+ 3 - 3
RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellAction.m

@@ -10,9 +10,9 @@
 
 @implementation CommonEditorCellAction
 
-- (void)awakeFromNib {
-    // Initialization code
-}
+//- (void)awakeFromNib {
+//    // Initialization code
+//}
 
 - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
     [super setSelected:selected animated:animated];

+ 4 - 4
RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellEnum.m

@@ -19,10 +19,10 @@
     return self;
 }
 
-- (void)awakeFromNib
-{
-    // Initialization code
-}
+//- (void)awakeFromNib
+//{
+//    // Initialization code
+//}
 
 - (void)setSelected:(BOOL)selected animated:(BOOL)animated
 {

+ 1 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellImg.m

@@ -16,6 +16,7 @@
 @implementation CommonEditorCellImg
 
 - (void)awakeFromNib {
+    [super awakeFromNib];
     self.touchImageView0.delegate=self;
 
     self.touchImageView1.delegate=self;

+ 3 - 3
RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellLabel.m

@@ -10,9 +10,9 @@
 
 @implementation CommonEditorCellLabel
 
-- (void)awakeFromNib {
-    // Initialization code
-}
+//- (void)awakeFromNib {
+//    // Initialization code
+//}
 
 - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
     [super setSelected:selected animated:animated];

+ 16 - 13
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m

@@ -330,19 +330,20 @@
     NSString *model = [UIDevice currentDevice].model;
     if ([model isEqualToString:@"iPhone"]||true) {
         [self setupEditorTable];
-    } else {
-        // 在键盘事件中,使用tableContainer计算frame 保证屏幕旋转后table height正确
-        if (self.tableContainer == nil) {
-            self.tableContainer = [[CommonEditorTableContainerView alloc] initWithFrame:self.editorTable.frame];
-            self.tableContainer.autoresizingMask = self.editorTable.autoresizingMask;
-            CGRect frame = self.editorTable.frame;
-            frame.origin.x = 0;
-            frame.origin.y = 0;
-            [self.view addSubview:self.tableContainer];
-            [self.view sendSubviewToBack:self.tableContainer];
-            [self.tableContainer addSubview:self.editorTable];
-        }
     }
+//    else {
+//        // 在键盘事件中,使用tableContainer计算frame 保证屏幕旋转后table height正确
+//        if (self.tableContainer == nil) {
+//            self.tableContainer = [[CommonEditorTableContainerView alloc] initWithFrame:self.editorTable.frame];
+//            self.tableContainer.autoresizingMask = self.editorTable.autoresizingMask;
+//            CGRect frame = self.editorTable.frame;
+//            frame.origin.x = 0;
+//            frame.origin.y = 0;
+//            [self.view addSubview:self.tableContainer];
+//            [self.view sendSubviewToBack:self.tableContainer];
+//            [self.tableContainer addSubview:self.editorTable];
+//        }
+//    }
     
     
     NSArray* nibView = [[NSBundle mainBundle] loadNibNamed:@"CommonEditorAutoCompleteView" owner:nil options:nil];
@@ -6641,7 +6642,9 @@
     }
  
 }
-
+- (void)MActionClicked:(UIButton *)sender {
+    [RAUtils message_alert:@"MActionClicked dose not impl" title:@"Warring" controller:self];
+}
 #pragma mark - Banner Delegate
 
 - (void)commonEditorBannerCell:(CommonEditorBannerCell *)cell didClickItemAtIndexPath:(NSIndexPath *)indexPath {

+ 1 - 0
RedAnt ERP Mobile/common/Functions/MainViewController.m

@@ -446,6 +446,7 @@
 
     [super viewDidLoad];
 //    NSLog(@"decrypt:%@",[AESCrypt fastdecrypt:@"vafHUwfRPIUbPNVnKhLc5aAVK7sOFRztlfJVRHW7QVa/qGgm11E5UwfYWZEBTQpH"]);
+ 
     
     self.automaticallyAdjustsScrollViewInsets = NO;
     NSString* value =[DefaultAppearance get_noneappearance_value:@"DefaultColor" valuename:@"labelcolor"];

+ 6 - 6
RedAnt ERP Mobile/common/Functions/cart/CartGeneralNotesViewController.m

@@ -23,12 +23,12 @@
     if (@available(iOS 11, *)) {
         self.tv_notes.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
     }
-    else {
-
-
-
-        self.automaticallyAdjustsScrollViewInsets = NO;
-    }
+//    else {
+//
+////        self.tv_notes.scrollView.contentInsetAdjustmentBehavior =UIScrollViewContentInsetAdjustmentNever;
+//
+//        self.automaticallyAdjustsScrollViewInsets = NO;
+//    }
 //    self.automaticallyAdjustsScrollViewInsets = NO;
     self.navigationController.navigationBar.translucent = NO;
     self.tv_notes.layer.borderColor = [UIColor lightGrayColor].CGColor;

+ 2 - 2
RedAnt ERP Mobile/common/Functions/cart/CartViewController.m

@@ -2092,8 +2092,8 @@
     
     if(/*appDelegate.user_type==USER_ROLE_CUSTOMER*/ true)
         [cell init_Stepper:stockUom max:9999 min:stockUom value:count];
-    else
-        [cell init_Stepper:1 max:9999 min:1 value:count];
+//    else
+//        [cell init_Stepper:1 max:9999 min:1 value:count];
     
     
     [cell set_Count:count];

+ 6 - 6
RedAnt ERP Mobile/common/Functions/cart/ItemNotesViewController.m

@@ -24,12 +24,12 @@
     if (@available(iOS 11, *)) {
         self.tv_notes.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
     }
-    else {
-
-
-
-        self.automaticallyAdjustsScrollViewInsets = NO;
-    }
+//    else {
+//
+//
+//
+//        self.automaticallyAdjustsScrollViewInsets = NO;
+//    }
     
 //    self.automaticallyAdjustsScrollViewInsets = NO;
     self.navigationController.navigationBar.translucent = NO;

+ 8 - 8
RedAnt ERP Mobile/common/Functions/home/HomeTableViewCellBanner.m

@@ -10,14 +10,14 @@
 
 @implementation HomeTableViewCellBanner
 
-- (void)awakeFromNib {
-    
-    
-//    self.BannerImageView.layer.borderColor = [[UIColor whiteColor] CGColor];
-//    self.BannerImageView.layer.borderWidth = 8;
-    
-    // Initialization code
-}
+//- (void)awakeFromNib {
+//    
+//    
+////    self.BannerImageView.layer.borderColor = [[UIColor whiteColor] CGColor];
+////    self.BannerImageView.layer.borderWidth = 8;
+//    
+//    // Initialization code
+//}
 
 - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
     [super setSelected:selected animated:animated];

+ 10 - 10
RedAnt ERP Mobile/common/Functions/home/HomeTableViewCellSlide.m

@@ -10,16 +10,16 @@
 
 @implementation HomeTableViewCellSlide
 
-- (void)awakeFromNib {
-    // Initialization code
-    
-    
-   // DebugLog(NSStringFromCGRect(self.frame));
-//    self.imgScroll =  [[CycleScrollView alloc] initWithFrame:self.frame  animationDuration:5];
-//    self.imgScroll.autoresizingMask =     UIViewAutoresizingFlexibleHeight  |UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin;
-//
-//    [self.contentView addSubview:self.imgScroll];
-}
+//- (void)awakeFromNib {
+//    // Initialization code
+//    
+//    
+//   // DebugLog(NSStringFromCGRect(self.frame));
+////    self.imgScroll =  [[CycleScrollView alloc] initWithFrame:self.frame  animationDuration:5];
+////    self.imgScroll.autoresizingMask =     UIViewAutoresizingFlexibleHeight  |UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin;
+////
+////    [self.contentView addSubview:self.imgScroll];
+//}
 
 - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
     [super setSelected:selected animated:animated];

+ 3 - 3
RedAnt ERP Mobile/common/Functions/home/HomeTableViewCellTopic.m

@@ -21,9 +21,9 @@
     }
     return self;
 }
-- (void)awakeFromNib {
-    // Initialization code
-}
+//- (void)awakeFromNib {
+//    // Initialization code
+//}
 
 - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
     [super setSelected:selected animated:animated];

+ 1 - 1
RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.h

@@ -69,7 +69,7 @@
 @property (strong, nonatomic) IBOutlet UIButton *btnaddWish;
 @property (strong, nonatomic) IBOutlet UIButton *btnaddPortfolio;
 @property (strong, nonatomic) IBOutlet UIButton *btnNotifyMe;
-@property (nonatomic,copy) void(^notifyMeBlock)();
+@property (nonatomic,copy) void(^notifyMeBlock)(void);
 
 @property (weak, nonatomic) IBOutlet UIButton *btn_hangtag;
 @property (strong, nonatomic) IBOutlet UILabel *eta_label;

+ 1 - 0
RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.m

@@ -41,6 +41,7 @@
 
 - (void)awakeFromNib
 {
+    [super awakeFromNib];
 #ifdef BUILD_UWAVER
     //    self.addPortfolioBtn.title = @"Add to Hang Tag";
     self.btn_hangtag.hidden=false;

+ 1 - 1
RedAnt ERP Mobile/common/Functions/modelDetail/DetailTopicCell.m

@@ -28,7 +28,7 @@
 - (void)awakeFromNib
 {
     // Initialization code
-    
+    [super awakeFromNib];
     self.refreshLabel.layer.borderColor = [UIColor darkGrayColor].CGColor;
     self.refreshLabel.layer.borderWidth = 2.0;
     self.refreshLabel.layer.cornerRadius=15;

+ 6 - 6
RedAnt ERP Mobile/common/Functions/modelDetail/ModelDescriptionController.m

@@ -23,12 +23,12 @@
     if (@available(iOS 11, *)) {
         self.desc_tv.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
     }
-    else {
-
-
-
-        self.automaticallyAdjustsScrollViewInsets = NO;
-    }
+//    else {
+//
+//
+//
+//        self.automaticallyAdjustsScrollViewInsets = NO;
+//    }
 //    self.automaticallyAdjustsScrollViewInsets = NO;
     self.desc_tv.text = self.model_desc;
     

+ 1 - 0
RedAnt ERP Mobile/common/Functions/order/RAOrderPreviewController.m

@@ -1805,6 +1805,7 @@
      [alertController addAction:action_1];
      [alertController addAction:action_2];
      [alertController addAction:action_3];
+    [alertController addAction:action_4];
      
      
      [self presentViewController:alertController animated:YES completion:nil];

+ 6 - 6
RedAnt ERP Mobile/common/customUI/ImageScrollerViewController.m

@@ -119,12 +119,12 @@
     if (@available(iOS 11, *)) {
         self.imgShowView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
     }
-    else {
-
-
-
-        self.automaticallyAdjustsScrollViewInsets = NO;
-    }
+//    else {
+//
+//
+//
+//        self.automaticallyAdjustsScrollViewInsets = NO;
+//    }
     // Do any additional setup after loading the view.
 }
 - (void)backAction{

+ 6 - 6
common/WK PDF+Web/RAPDFViewController.m

@@ -51,12 +51,12 @@
     if (@available(iOS 11, *)) {
         self.wkWebview.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
     }
-    else {
-
-
-
-        self.automaticallyAdjustsScrollViewInsets = NO;
-    }
+//    else {
+//
+//        
+//
+//        self.automaticallyAdjustsScrollViewInsets = NO;
+//    }
 
    // self.btnsave.tintColor = UIColorFromRGB(0x996633);