فهرست منبع

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

Ray Zhang 6 سال پیش
والد
کامیت
dd69483c2b
27فایلهای تغییر یافته به همراه208 افزوده شده و 111 حذف شده
  1. 13 5
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m
  2. 1 1
      RedAnt ERP Mobile/common/Functions/contact/ContactListViewController.m
  3. 8 4
      RedAnt ERP Mobile/common/Functions/home/HomeViewController.m
  4. 10 2
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.m
  5. 1 1
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.h
  6. 37 30
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m
  7. 4 2
      RedAnt ERP Mobile/common/Functions/offline/SyncControlPanelViewController.m
  8. 7 2
      RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m
  9. 8 2
      RedAnt ERP Mobile/common/Functions/order/RAOrderEditorViewController.m
  10. 7 2
      RedAnt ERP Mobile/common/Functions/order/RAOrderPreviewController.m
  11. 1 1
      RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchFilterViewController.m
  12. 4 2
      RedAnt ERP Mobile/common/Functions/sidemenu/ScannerSettingViewController.m
  13. 1 1
      RedAnt ERP Mobile/common/Functions/signature/SignatureViewController.h
  14. 4 4
      RedAnt ERP Mobile/common/Functions/signature/SignatureViewController.m
  15. 5 2
      RedAnt ERP Mobile/common/RAUtils.h
  16. 48 28
      RedAnt ERP Mobile/common/RAUtils.m
  17. 5 5
      RedAnt ERP Mobile/common/TextUtils.m
  18. 1 1
      RedAnt ERP Mobile/common/customUI/ImageScrollerView.h
  19. 7 2
      RedAnt ERP Mobile/common/customUI/MDHTMLLabel.m
  20. 1 1
      RedAnt ERP Mobile/common/customUI/PulldownMenu.m
  21. 4 1
      RedAnt ERP Mobile/common/customUI/RTLabel.m
  22. 5 2
      RedAnt ERP Mobile/common/customUI/StrikethroughLabel.m
  23. 1 1
      RedAnt ERP Mobile/common/data_provider/iSalesDB.m
  24. 12 0
      RedAnt ERP Mobile/common/pdfCreator/PDFDrawable.m
  25. 6 3
      RedAnt ERP Mobile/common/photoStack/PhotoStackViewController.m
  26. 3 3
      common/NetworkUtils.m
  27. 4 3
      common/WK PDF+Web/RAPDFViewController.m

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

@@ -1098,7 +1098,12 @@
     //    titleLabel.textAlignment = NSTextAlignmentRight;
     titleLabel.textAlignment = NSTextAlignmentCenter;
     CGSize constraintkey = CGSizeMake(270, 20000.0f);//key label width is 40% cell width;
-    CGSize sizetitle = [@"Please complete missing fields:" sizeWithFont:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+    
+    
+//    CGSize sizetitle = [@"Please complete missing fields:" sizeWithFont:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+//
+    CGSize sizetitle = [RAUtils sizeWithFont:@"Please complete missing fields:" font:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+    
     
     //[titleLabel sizeToFit];
     //    titleLabel.center.x = demoView.center.x;
@@ -1111,7 +1116,9 @@
     lineLabel.numberOfLines = 0;
     lineLabel.lineBreakMode =NSLineBreakByWordWrapping;
     
-    CGSize sizemsg = [msg sizeWithFont:[UIFont boldSystemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+//    CGSize sizemsg = [msg sizeWithFont:[UIFont boldSystemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+    
+    CGSize sizemsg = [RAUtils sizeWithFont:msg font:[UIFont boldSystemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
     
     lineLabel.frame = CGRectMake(15, titleLabel.frame.origin.y+ titleLabel.frame.size.height+20, 260, sizemsg.height);
     //[lineLabel sizeToFit];
@@ -2054,7 +2061,7 @@
                 else
                 {
                     
-                    assert(@"not impl");
+                    NSAssert(true,@"not impl");
                     NSArray* idarr=[subid componentsSeparatedByString:@"_"];
                     int section = [(NSString*)idarr[0] intValue];
                     int item=[(NSString*)idarr[1] intValue];
@@ -2245,7 +2252,7 @@
                 else
                 {
                     
-                    assert(@"not impl");
+                    NSAssert(true,@"not impl");
                     NSArray* idarr=[subid componentsSeparatedByString:@"_"];
                     int section = [(NSString*)idarr[0] intValue];
                     int item=[(NSString*)idarr[1] intValue];
@@ -4855,7 +4862,7 @@
                         [item_json setValue:img_url_up forKey:@"value"];
                         [item_json setValue:@"true" forKey:@"dirty"];
                         NSMutableDictionary* section_json = [[weakself.content_data_download objectForKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]] mutableCopy];
-                        [section_json setObject:item_json forKey:[NSString stringWithFormat:@"item_%d",indexPath.row]];
+                        [section_json setObject:item_json forKey:[NSString stringWithFormat:@"item_%ld",indexPath.row]];
                         
                         [weakself.content_data_download setObject:section_json forKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]];
                         weakself.content_data_control = [weakself translate_json:weakself.content_data_download changed:weakself.changed_data];
@@ -6367,6 +6374,7 @@
             } else {
                 // 向上移动到topLayoutGuide,不足部分通过缩减高度到达keyboard顶部
                 table_frame.origin.y = -topAvailableHeight;
+                
                 table_frame.size.height = (end_y - self.topLayoutGuide.length);
             }
         } else {

+ 1 - 1
RedAnt ERP Mobile/common/Functions/contact/ContactListViewController.m

@@ -510,7 +510,7 @@
     
     cuseditVC.params = params;
     
-    cuseditVC.delegate=self;
+//    cuseditVC.delegate=self;
     //
     //    if(checked.count==count)
     //    {

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

@@ -55,7 +55,7 @@
     [super viewWillAppear:animated];
     [[self navigationController] setNavigationBarHidden:YES animated:NO];
     
-    if(!CGSizeEqualToSize(self.ori_size, [[UIScreen mainScreen] applicationFrame].size))
+    if(!CGSizeEqualToSize(self.ori_size, [[UIScreen mainScreen] bounds].size))
     {
             [self.homeTable reloadData];
     }
@@ -65,7 +65,7 @@
 -(void) viewWillDisappear:(BOOL)animated
 {
     
-    self.ori_size=[[UIScreen mainScreen] applicationFrame].size;
+    self.ori_size=[[UIScreen mainScreen] bounds].size;
 //                                            [[NSNotificationCenter defaultCenter] postNotificationName:CYCLESCROLL_STOPTIMMER object:nil];
 //    self.bak_content = self.content;
 //    self.content= nil;
@@ -598,9 +598,13 @@
     {
         
         NSString *CellIdentifier = @"HomeTableViewCellBanner";
-        cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
+//        cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
+//
+//        HomeTableViewCellBanner * bannercell=cell;
+        
+        
         
-        HomeTableViewCellBanner * bannercell=cell;
+        HomeTableViewCellBanner * bannercell=[tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];;
         NSString* img_url =[view_json valueForKeyPath:@"img"];
         NSString* file_name=[img_url lastPathComponent];
         NSData* img_data=[ImageUtils load_cached_img:file_name loadFrom:img_url size:bannercell.BannerImageView.frame.size allow_enlarge:false];

+ 10 - 2
RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.m

@@ -1263,7 +1263,12 @@
     //    titleLabel.textAlignment = NSTextAlignmentRight;
     titleLabel.textAlignment = NSTextAlignmentCenter;
     CGSize constraintkey = CGSizeMake(620, 20000.0f);//key label width is 40% cell width;
-    CGSize sizetitle = [@"a separated player will show here:" sizeWithFont:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+    
+//    CGSize sizetitle = [@"a separated player will show here:" sizeWithFont:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+
+    
+    CGSize sizetitle = [RAUtils sizeWithFont:@"a separated player will show here:" font:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+
     
     //[titleLabel sizeToFit];
     //    titleLabel.center.x = demoView.center.x;
@@ -1276,7 +1281,10 @@
     lineLabel.numberOfLines = 0;
     lineLabel.lineBreakMode =NSLineBreakByWordWrapping;
     
-    CGSize sizemsg = [videoID sizeWithFont:[UIFont boldSystemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+//    CGSize sizemsg = [videoID sizeWithFont:[UIFont boldSystemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+    
+    
+    CGSize sizemsg = [RAUtils sizeWithFont:videoID font:[UIFont boldSystemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
     
     lineLabel.frame = CGRectMake(15, titleLabel.frame.origin.y+ titleLabel.frame.size.height+20, 630, sizemsg.height);
     //[lineLabel sizeToFit];

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

@@ -12,7 +12,7 @@
 //#import "SelectorViewController.h"
 #import "ActiveViewController.h"
 #import "NIDropDown.h"
-@interface DetailViewController : ActiveViewController<UITableViewDataSource,UITableViewDelegate,DetailRelatedCellDelegate,DetailHeaderCellDelegate,/*SelectorDelegate,*/NIDropDownDelegate>
+@interface DetailViewController : ActiveViewController<UITableViewDataSource,UITableViewDelegate,DetailRelatedCellDelegate,DetailHeaderCellDelegate/*,SelectorDelegate,*//*NIDropDownDelegate*/>
 @property (strong,nonatomic) NSMutableDictionary* detail_data;
 @property (strong,nonatomic) NSString* product_id;
 @property (strong,nonatomic) NSString* model_name;

+ 37 - 30
RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m

@@ -1197,7 +1197,9 @@ dispatch_async(dispatch_get_main_queue(), ^{
             CGSize sizeval=rtlabel.optimumSize;
             
             
-            CGSize sizekey = [key sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+//            CGSize sizekey = [key sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+            CGSize sizekey = [RAUtils sizeWithFont:key font:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+            
             //           CGSize sizeval = [val sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintval lineBreakMode:NSLineBreakByWordWrapping];
             float height = MAX(sizekey.height,sizeval.height);
             height = MAX(height+LINE_WIDTH, DEF_CELL_HEIGHT);
@@ -1270,7 +1272,10 @@ dispatch_async(dispatch_get_main_queue(), ^{
                 CGSize sizeval=rtlabel.optimumSize;
                 
                 
-                CGSize sizekey = [key sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+//                CGSize sizekey = [key sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+                
+                CGSize sizekey = [RAUtils sizeWithFont:key font:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+                
                 //           CGSize sizeval = [val sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintval lineBreakMode:NSLineBreakByWordWrapping];
                 float height = MAX(sizekey.height,sizeval.height);
                 height = MAX(height+LINE_WIDTH, DEF_CELL_HEIGHT);
@@ -2290,7 +2295,9 @@ dispatch_async(dispatch_get_main_queue(), ^{
             //        rtlabel.lineSpacing = 20.0;
             [rtlabel setText: val];
             CGSize sizeval=rtlabel.optimumSize;
-            CGSize sizekey = [key sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+//            CGSize sizekey = [key sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+            
+            CGSize sizekey = [RAUtils sizeWithFont:key font:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
             
             float height = MAX(sizekey.height,sizeval.height);
             height = MAX(height, DEF_CELL_HEIGHT-LINE_WIDTH);
@@ -2501,36 +2508,36 @@ dispatch_async(dispatch_get_main_queue(), ^{
     groups.duration = 1.0f;
     groups.removedOnCompletion=NO;
     groups.fillMode=kCAFillModeForwards;
-    groups.delegate = self;
+//    groups.delegate = self;
     [_layer addAnimation:groups forKey:@"group"];
 }
 
--(void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
-{
-    //    [anim def];
-    if (anim == [_layer animationForKey:@"group"]) {
-        self.detailTable.userInteractionEnabled = YES;
-        //        _btn.enabled = YES;
-        [_layer removeFromSuperlayer];
-        _layer = nil;
-        
-        
-//        _cnt++;
-//        if (_cnt) {
-//            _cntLabel.hidden = NO;
-//        }
-//        CATransition *animation = [CATransition animation];
-//        animation.duration = 0.25f;
-//        _cntLabel.text = [NSString stringWithFormat:@"%d",_cnt];
-//        [_cntLabel.layer addAnimation:animation forKey:nil];
-//        CABasicAnimation *shakeAnimation = [CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
-//        shakeAnimation.duration = 0.25f;
-//        shakeAnimation.fromValue = [NSNumber numberWithFloat:-5];
-//        shakeAnimation.toValue = [NSNumber numberWithFloat:5];
-//        shakeAnimation.autoreverses = YES;
-//        [_btn.layer addAnimation:shakeAnimation forKey:nil];
-    }
-}
+//-(void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
+//{
+//    //    [anim def];
+//    if (anim == [_layer animationForKey:@"group"]) {
+//        self.detailTable.userInteractionEnabled = YES;
+//        //        _btn.enabled = YES;
+//        [_layer removeFromSuperlayer];
+//        _layer = nil;
+//        
+//        
+////        _cnt++;
+////        if (_cnt) {
+////            _cntLabel.hidden = NO;
+////        }
+////        CATransition *animation = [CATransition animation];
+////        animation.duration = 0.25f;
+////        _cntLabel.text = [NSString stringWithFormat:@"%d",_cnt];
+////        [_cntLabel.layer addAnimation:animation forKey:nil];
+////        CABasicAnimation *shakeAnimation = [CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
+////        shakeAnimation.duration = 0.25f;
+////        shakeAnimation.fromValue = [NSNumber numberWithFloat:-5];
+////        shakeAnimation.toValue = [NSNumber numberWithFloat:5];
+////        shakeAnimation.autoreverses = YES;
+////        [_btn.layer addAnimation:shakeAnimation forKey:nil];
+//    }
+//}
 #pragma mark - hide section button clicked
 - (void)RefreshSection:(UIButton *)sender {
     

+ 4 - 2
RedAnt ERP Mobile/common/Functions/offline/SyncControlPanelViewController.m

@@ -133,7 +133,8 @@
 //    [mc addAttachmentData:data mimeType:@"text/plain" fileName:filename];
     [mc addAttachmentData:data1 mimeType:@"application/zip" fileName:@"db.zip"];
     
-    [self presentModalViewController:mc animated:YES];
+//    [self presentModalViewController:mc animated:YES];
+    [self presentViewController:mc animated:YES completion:nil];
     
     return;
     
@@ -195,6 +196,7 @@
         default:
             break;
     }
-    [self dismissModalViewControllerAnimated:YES];
+//    [self dismissModalViewControllerAnimated:YES];
+    [self dismissViewControllerAnimated:YES completion:nil];
 }
 @end

+ 7 - 2
RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m

@@ -1661,8 +1661,11 @@
     //    titleLabel.textAlignment = NSTextAlignmentRight;
     titleLabel.textAlignment = NSTextAlignmentCenter;
     CGSize constraintkey = CGSizeMake(270, 20000.0f);//key label width is 40% cell width;
-    CGSize sizetitle = [titleLabel.text=@"Order Submission" sizeWithFont:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
     
+//    CGSize sizetitle = [titleLabel.text=@"Order Submission" sizeWithFont:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+
+    CGSize sizetitle = [RAUtils sizeWithFont:titleLabel.text=@"Order Submission" font:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+
     //[titleLabel sizeToFit];
     //    titleLabel.center.x = demoView.center.x;
     titleLabel.frame = CGRectMake(10, 10, 270, sizetitle.height);
@@ -1674,7 +1677,9 @@
     lineLabel.numberOfLines = 0;
     lineLabel.lineBreakMode =NSLineBreakByWordWrapping;
     
-    CGSize sizemsg = [msg sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+//    CGSize sizemsg = [msg sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+    
+    CGSize sizemsg = [RAUtils sizeWithFont:msg font:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
     
     lineLabel.frame = CGRectMake(15, titleLabel.frame.origin.y+ titleLabel.frame.size.height+20, 260, sizemsg.height);
     //[lineLabel sizeToFit];

+ 8 - 2
RedAnt ERP Mobile/common/Functions/order/RAOrderEditorViewController.m

@@ -827,7 +827,10 @@ static const int totalPage = 3;
     //    titleLabel.textAlignment = NSTextAlignmentRight;
     titleLabel.textAlignment = NSTextAlignmentCenter;
     CGSize constraintkey = CGSizeMake(270, 20000.0f);//key label width is 40% cell width;
-    CGSize sizetitle = [titleLabel.text=@"Order Submission" sizeWithFont:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+//    CGSize sizetitle = [titleLabel.text=@"Order Submission" sizeWithFont:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+
+    CGSize sizetitle = [RAUtils sizeWithFont:titleLabel.text=@"Order Submission" font:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+
     
     //[titleLabel sizeToFit];
     //    titleLabel.center.x = demoView.center.x;
@@ -840,7 +843,10 @@ static const int totalPage = 3;
     lineLabel.numberOfLines = 0;
     lineLabel.lineBreakMode =NSLineBreakByWordWrapping;
     
-    CGSize sizemsg = [msg sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+//    CGSize sizemsg = [msg sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+    
+    CGSize sizemsg = [RAUtils sizeWithFont:msg font:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+    
     
     lineLabel.frame = CGRectMake(15, titleLabel.frame.origin.y+ titleLabel.frame.size.height+20, 260, sizemsg.height);
     //[lineLabel sizeToFit];

+ 7 - 2
RedAnt ERP Mobile/common/Functions/order/RAOrderPreviewController.m

@@ -1675,7 +1675,10 @@
     //    titleLabel.textAlignment = NSTextAlignmentRight;
     titleLabel.textAlignment = NSTextAlignmentCenter;
     CGSize constraintkey = CGSizeMake(270, 20000.0f);//key label width is 40% cell width;
-    CGSize sizetitle = [titleLabel.text=@"Order Submission" sizeWithFont:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+//    CGSize sizetitle = [titleLabel.text=@"Order Submission" sizeWithFont:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+    
+    CGSize sizetitle = [RAUtils sizeWithFont:titleLabel.text=@"Order Submission" font:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+    
     
     //[titleLabel sizeToFit];
     //    titleLabel.center.x = demoView.center.x;
@@ -1688,7 +1691,9 @@
     lineLabel.numberOfLines = 0;
     lineLabel.lineBreakMode =NSLineBreakByWordWrapping;
     
-    CGSize sizemsg = [msg sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+//    CGSize sizemsg = [msg sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+    
+    CGSize sizemsg = [RAUtils sizeWithFont:msg font:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
     
     lineLabel.frame = CGRectMake(15, titleLabel.frame.origin.y+ titleLabel.frame.size.height+20, 260, sizemsg.height);
     //[lineLabel sizeToFit];

+ 1 - 1
RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchFilterViewController.m

@@ -580,7 +580,7 @@
     
     
     EnumSelectViewController* enumvc =[[UIStoryboard storyboardWithName:@"CommonEditor" bundle:nil] instantiateViewControllerWithIdentifier:@"EnumSelectorViewController"];
-    enumvc.delegate = self;
+//    enumvc.delegate = self;
     enumvc.max_select = 1;
     //enumvc.updatePosition = indexPath;
     //        if([[required lowercaseString] isEqualToString:@"true"])

+ 4 - 2
RedAnt ERP Mobile/common/Functions/sidemenu/ScannerSettingViewController.m

@@ -259,7 +259,8 @@
 //    if(self.attachment_name.length>0)
 //        filename = self.attachment_name;
     [mc addAttachmentData:data mimeType:@"text/plain" fileName:filename];
-    [self presentModalViewController:mc animated:YES];
+//    [self presentModalViewController:mc animated:YES];
+    [self presentViewController:mc animated:YES completion:nil];
     
     return;
     
@@ -336,7 +337,8 @@
         default:
             break;
     }
-    [self dismissModalViewControllerAnimated:YES];
+//    [self dismissModalViewControllerAnimated:YES];
+    [self dismissViewControllerAnimated:YES completion:nil];
 }
 #pragma mark -UITableViewDataSource
 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

+ 1 - 1
RedAnt ERP Mobile/common/Functions/signature/SignatureViewController.h

@@ -21,7 +21,7 @@
 @property (strong, nonatomic)  SignatureView *signatureView;
 @property (strong,nonatomic) NSIndexPath *indexPath;
 //@property (strong,nonatomic) UIImage *existSignature;
-@property (nonatomic, weak) id<SignatureViewControllerDelegate> delegate;
+@property (nonatomic, weak) id<SignatureViewControllerDelegate> Signaturedelegate;
 @property (nonatomic , copy) void (^onReturnImg)(UIImage* img);
 @property CGSize signature_ratio;
 @property int linewidth;

+ 4 - 4
RedAnt ERP Mobile/common/Functions/signature/SignatureViewController.m

@@ -230,12 +230,12 @@
 //    CGSize imgsize = img.size;
     NSData* data = [self.signatureView signatureData];
     
-   if (self.delegate && [self.delegate respondsToSelector:@selector(SignatureVCReturnImage:indexPath:)]) {
-       [self.delegate SignatureVCReturnImage:img indexPath:self.indexPath];
+   if (self.Signaturedelegate && [self.Signaturedelegate respondsToSelector:@selector(SignatureVCReturnImage:indexPath:)]) {
+       [self.Signaturedelegate SignatureVCReturnImage:img indexPath:self.indexPath];
    }
     
-    if (self.delegate && [self.delegate respondsToSelector:@selector(SignatureVCReturnData:indexPath:)]) {
-        [self.delegate SignatureVCReturnData:data indexPath:self.indexPath];
+    if (self.Signaturedelegate && [self.Signaturedelegate respondsToSelector:@selector(SignatureVCReturnData:indexPath:)]) {
+        [self.Signaturedelegate SignatureVCReturnData:data indexPath:self.indexPath];
     }
     if(self.onReturnImg)
         self.onReturnImg(img);

+ 5 - 2
RedAnt ERP Mobile/common/RAUtils.h

@@ -20,6 +20,9 @@
 
 @interface RAUtils : NSObject
 
+
++ (CGSize)sizeWithFont:(NSString*)string font:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(NSLineBreakMode)lineBreakMode;
+
 + (BOOL)isNumeric:(NSString*)string;
 //+(NSData*) dict2data:(NSDictionary*) dict;
 +(NSString*) FloatFormat:(float)value;
@@ -44,8 +47,8 @@
 + (NSArray*) allFilesAtPath:(NSString*) dirString;
 //+(void) enum_font;
 +(NSDictionary*) dictfromfile:(NSString*) path;
-+(NSArray*) expression_varable:(NSString*)content regex:(NSString*) pattern;
-+(NSTextCheckingResult*) expression_findfistMatch:(NSString*)content regex:(NSString*) pattern;
+//+(NSArray*) expression_varable:(NSString*)content regex:(NSString*) pattern;
+//+(NSTextCheckingResult*) expression_findfistMatch:(NSString*)content regex:(NSString*) pattern;
 +(NSData*) getdbfile;
 +(NSString*) getdbzip;
 + (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size;

+ 48 - 28
RedAnt ERP Mobile/common/RAUtils.m

@@ -179,12 +179,32 @@
 //}
 
 
-+(NSTextCheckingResult*) expression_findfistMatch:(NSString*)content regex:(NSString*) pattern
-{
-    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil];
-    
-    NSTextCheckingResult *match = [regex firstMatchInString:content options:0 range:NSMakeRange(0, content.length)];
-    return match;
+//+(NSTextCheckingResult*) expression_findfistMatch:(NSString*)content regex:(NSString*) pattern
+//{
+//    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil];
+//    
+//    NSTextCheckingResult *match = [regex firstMatchInString:content options:0 range:NSMakeRange(0, content.length)];
+//    return match;
+////    if (matches) {
+////        for (NSTextCheckingResult *match in matches) {
+////            for (int i = 0; i < match.numberOfRanges; ++i) {
+////                DebugLog(@"-> %@", [content substringWithRange:[match rangeAtIndex:i]]);
+////            }
+////        }
+////    }
+////    return matches;
+//}
+//+(NSArray*) expression_varable:(NSString*)content regex:(NSString*) pattern
+//{
+//
+//    if(content==nil)
+//        return nil;
+//
+//
+//    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil];
+//
+//    NSArray *matches = [regex matchesInString:content options:0 range:NSMakeRange(0, content.length)];
+//
 //    if (matches) {
 //        for (NSTextCheckingResult *match in matches) {
 //            for (int i = 0; i < match.numberOfRanges; ++i) {
@@ -193,27 +213,7 @@
 //        }
 //    }
 //    return matches;
-}
-+(NSArray*) expression_varable:(NSString*)content regex:(NSString*) pattern
-{
-    
-    if(content==nil)
-        return nil;
-
-    
-    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil];
-    
-    NSArray *matches = [regex matchesInString:content options:0 range:NSMakeRange(0, content.length)];
-    
-    if (matches) {
-        for (NSTextCheckingResult *match in matches) {
-            for (int i = 0; i < match.numberOfRanges; ++i) {
-                DebugLog(@"-> %@", [content substringWithRange:[match rangeAtIndex:i]]);
-            }
-        }  
-    }
-    return matches;
-}
+//}
 + (CGRect)rectAlign:(CGRect )parent rect:(CGRect)rect hAlign:(NSString*)hAlign vAlign:(NSString*)vAlign
 {
 //    double cx=parent.origin.x+parent.size.width/2;
@@ -951,7 +951,8 @@ done:
         return @"";
     
     NSData *imageData = UIImageJPEGRepresentation(image,1.0);
-    NSString *imageSource = [NSString stringWithFormat:@"data:image/jpg;base64,%@",[imageData base64Encoding]];
+//    NSString *imageSource = [NSString stringWithFormat:@"data:image/jpg;base64,%@",[imageData base64Encoding]];
+    NSString *imageSource = [NSString stringWithFormat:@"data:image/jpg;base64,%@",[imageData base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed]];
     imageSource=[NSString stringWithFormat:@"<img src = \"%@\" />", imageSource];
     
     
@@ -989,6 +990,25 @@ done:
     
 }
 
+
+
++ (CGSize)sizeWithFont:(NSString*)string font:(UIFont *)font constrainedToSize:(CGSize)maxsize lineBreakMode:(NSLineBreakMode)lineBreakMode
+{
+    // Let's make an NSAttributedString first
+    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:string];
+    //Add LineBreakMode
+    NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
+    [paragraphStyle setLineBreakMode:lineBreakMode];
+    [attributedString setAttributes:@{NSParagraphStyleAttributeName:paragraphStyle} range:NSMakeRange(0, attributedString.length)];
+    // Add Font
+    [attributedString setAttributes:@{NSFontAttributeName:font} range:NSMakeRange(0, attributedString.length)];
+
+    //Now let's make the Bounding Rect
+    CGSize expectedSize = [attributedString boundingRectWithSize:maxsize options:NSStringDrawingUsesLineFragmentOrigin context:nil].size;
+    
+    return expectedSize;
+}
+
 @end
 
 

+ 5 - 5
RedAnt ERP Mobile/common/TextUtils.m

@@ -136,7 +136,7 @@
         return nil;
     
     
-    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:nil error:nil];
+    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil];
     NSString* sss = [regex stringByReplacingMatchesInString:content options:0 range:NSMakeRange(0, content.length) withTemplate:to_pattern];
     
     return sss;
@@ -148,9 +148,9 @@
         return nil;
     
     
-    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:nil error:nil];
+    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil];
     
-    NSArray *matches = [regex matchesInString:content options:nil range:NSMakeRange(0, content.length)];
+    NSArray *matches = [regex matchesInString:content options:0 range:NSMakeRange(0, content.length)];
     
     if (matches) {
         for (NSTextCheckingResult *match in matches) {
@@ -163,9 +163,9 @@
 }
 +(NSTextCheckingResult*) expression_findfistMatch:(NSString*)content regex:(NSString*) pattern
 {
-    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:nil error:nil];
+    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil];
     
-    NSTextCheckingResult *match = [regex firstMatchInString:content options:nil range:NSMakeRange(0, content.length)];
+    NSTextCheckingResult *match = [regex firstMatchInString:content options:0 range:NSMakeRange(0, content.length)];
     return match;
     //    if (matches) {
     //        for (NSTextCheckingResult *match in matches) {

+ 1 - 1
RedAnt ERP Mobile/common/customUI/ImageScrollerView.h

@@ -30,5 +30,5 @@ typedef NS_ENUM(NSInteger, MRImgLocation) {
 - (id)initWithFrame:(CGRect)frame withSourceData:(NSMutableArray *)imgSource withIndex:(NSInteger)index;
 - (id)initWithFrame:(CGRect)frame withSourceURL:(NSMutableArray *)imgURL withIndex:(NSInteger)index;
 // 谦让双击放大手势
-- (void)requireDoubleGestureRecognizer:(UITapGestureRecognizer *)tep;
+//- (void)requireDoubleGestureRecognizer:(UITapGestureRecognizer *)tep;
 @end

+ 7 - 2
RedAnt ERP Mobile/common/customUI/MDHTMLLabel.m

@@ -1015,7 +1015,10 @@ static inline CGSize CTFramesetterSuggestFrameSizeForAttributedStringWithConstra
     {
         { kCTParagraphStyleSpecifierAlignment, sizeof(CTTextAlignment), &textAlignment },
 		{ kCTParagraphStyleSpecifierLineBreakMode, sizeof(CTLineBreakMode), &lineBreakMode  },
-		{ kCTParagraphStyleSpecifierLineSpacing, sizeof(CGFloat), &lineSpacing },
+//		{ kCTParagraphStyleSpecifierLineSpacing, sizeof(CGFloat), &lineSpacing },
+        
+        { kCTParagraphStyleSpecifierMaximumLineSpacing, sizeof(CGFloat), &lineSpacing },
+        { kCTParagraphStyleSpecifierMinimumLineSpacing, sizeof(CGFloat), &lineSpacing },
         { kCTParagraphStyleSpecifierLineSpacingAdjustment, sizeof(CGFloat), &lineSpacingAdjustment },
         { kCTParagraphStyleSpecifierLineHeightMultiple, sizeof(CGFloat), &lineHeightMultiple },
         { kCTParagraphStyleSpecifierParagraphSpacingBefore, sizeof(CGFloat), &topMargin },
@@ -1061,7 +1064,9 @@ static inline CGSize CTFramesetterSuggestFrameSizeForAttributedStringWithConstra
     {
         { kCTParagraphStyleSpecifierAlignment, sizeof(CTTextAlignment), &textAlignment },
 		{ kCTParagraphStyleSpecifierLineBreakMode, sizeof(CTLineBreakMode), &lineBreakMode  },
-		{ kCTParagraphStyleSpecifierLineSpacing, sizeof(CGFloat), &lineSpacing },
+//		{ kCTParagraphStyleSpecifierLineSpacing, sizeof(CGFloat), &lineSpacing },
+        { kCTParagraphStyleSpecifierMaximumLineSpacing, sizeof(CGFloat), &lineSpacing },
+        { kCTParagraphStyleSpecifierMinimumLineSpacing, sizeof(CGFloat), &lineSpacing },
         { kCTParagraphStyleSpecifierLineSpacingAdjustment, sizeof(CGFloat), &lineSpacingAdjustment },
         { kCTParagraphStyleSpecifierLineHeightMultiple, sizeof(CGFloat), &lineHeightMultiple },
         { kCTParagraphStyleSpecifierParagraphSpacingBefore, sizeof(CGFloat), &topMargin },

+ 1 - 1
RedAnt ERP Mobile/common/customUI/PulldownMenu.m

@@ -438,7 +438,7 @@
     
     BOOL isStatusBarShowing = ![[UIApplication sharedApplication] isStatusBarHidden];
     
-    if (UIInterfaceOrientationIsLandscape(self.window.rootViewController.interfaceOrientation)) {
+    if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication]statusBarOrientation]/*self.window.rootViewController.interfaceOrientation*/)) {
         if (isStatusBarShowing) { topMargin = [UIApplication.sharedApplication statusBarFrame].size.width; }
         topMargin += topMarginLandscape;
     }

+ 4 - 1
RedAnt ERP Mobile/common/customUI/RTLabel.m

@@ -522,7 +522,10 @@
 		{ kCTParagraphStyleSpecifierAlignment, sizeof(CTTextAlignment), &textAlignment },
 		{ kCTParagraphStyleSpecifierLineBreakMode, sizeof(CTLineBreakMode), &lineBreakMode  },
 		{ kCTParagraphStyleSpecifierBaseWritingDirection, sizeof(CTWritingDirection), &direction },
-		{ kCTParagraphStyleSpecifierLineSpacing, sizeof(CGFloat), &lineSpacing },
+//		{ kCTParagraphStyleSpecifierLineSpacing, sizeof(CGFloat), &lineSpacing },
+        { kCTParagraphStyleSpecifierMaximumLineSpacing, sizeof(CGFloat), &lineSpacing },
+        { kCTParagraphStyleSpecifierMinimumLineSpacing, sizeof(CGFloat), &lineSpacing },
+        
 		{ kCTParagraphStyleSpecifierFirstLineHeadIndent, sizeof(CGFloat), &firstLineIndent },
 		{ kCTParagraphStyleSpecifierHeadIndent, sizeof(CGFloat), &headIndent },
 		{ kCTParagraphStyleSpecifierTailIndent, sizeof(CGFloat), &tailIndent },

+ 5 - 2
RedAnt ERP Mobile/common/customUI/StrikethroughLabel.m

@@ -7,7 +7,7 @@
 //
 
 #import "StrikethroughLabel.h"
-
+#import "RAUtils.h"
 @implementation StrikethroughLabel
 
 - (id)initWithFrame:(CGRect)frame
@@ -32,7 +32,10 @@
     CGContextSetLineWidth(context, 0.5);
     
     
-     CGSize sizekey = [self.text sizeWithFont:self.font constrainedToSize:self.frame.size lineBreakMode:NSLineBreakByWordWrapping];
+//     CGSize sizekey = [self.text sizeWithFont:self.font constrainedToSize:self.frame.size lineBreakMode:NSLineBreakByWordWrapping];
+    
+    CGSize sizekey = [RAUtils sizeWithFont:self.text font:self.font constrainedToSize:self.frame.size lineBreakMode:NSLineBreakByWordWrapping];
+    
 //    double width = sizekey.width*1.1;
 //    
 //    if(width>self.frame.size.width)

+ 1 - 1
RedAnt ERP Mobile/common/data_provider/iSalesDB.m

@@ -104,7 +104,7 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
             
             //DebugLog (@"%@", [[[NSString alloc] initWithUTF8String:(char *) rString] autorelease]);
             
-            sqlite3_result_text(context, rString, strlen(rString) * sizeof(char), NULL);
+            sqlite3_result_text(context, rString, (int)(strlen(rString) * sizeof(char)), NULL);
             break;
         }
         default: {

+ 12 - 0
RedAnt ERP Mobile/common/pdfCreator/PDFDrawable.m

@@ -136,5 +136,17 @@
 //{
 //
 //}
+#pragma mark NOT IMPL
+-(CGRect) Query_Rect:(CGContextRef) context dataSource:(NSMutableDictionary*)data ParentRect:(CGRect)p_rect startX:(double) x startY:(double) y flipHeight:(double)flip_height range:(NSRange)between_header_and_footer
+{
+    
+    NSAssert(true, @"NOT IMPL");
+    return CGRectNull;
+}
 
+-(CGRect) Draw:(CGContextRef) context dataSource:(NSMutableDictionary*)data ParentRect:(CGRect)p_rect startX:(double) x startY:(double) y flipHeight:(double)flip_height range:(NSRange)between_header_and_footer
+{
+    NSAssert(true, @"NOT IMPL");
+    return CGRectNull;
+}
 @end

+ 6 - 3
RedAnt ERP Mobile/common/photoStack/PhotoStackViewController.m

@@ -122,11 +122,14 @@
     [super viewDidLoad];
     [self setup];
 }
-
-- (void)viewDidUnload {
+-(void)dealloc
+{
     [self setPageControl:nil];
-    [super viewDidUnload];
 }
+//- (void)viewDidUnload {
+//    [self setPageControl:nil];
+//    [super viewDidUnload];
+//}
 //
 //- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
 //    return (interfaceOrientation == UIInterfaceOrientationPortrait);

+ 3 - 3
common/NetworkUtils.m

@@ -1085,7 +1085,7 @@ repeat:
         NSURLSessionDataTask *dataTask =[urlSession dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
             
                         NSData *responseData =data;
-                        NSHTTPURLResponse* urlResponse =response;
+                        NSHTTPURLResponse* urlResponse =(NSHTTPURLResponse*)response;
                         if (responseData==nil) {
 
                             //            DebugLog(@"response error:%@", [error localizedDescription]);
@@ -1448,7 +1448,7 @@ repeat:
     
     NSURLSessionDownloadTask* downloadTask=[urlSession downloadTaskWithRequest:request completionHandler:^(NSURL * _Nullable location, NSURLResponse * _Nullable response, NSError * _Nullable error) {
         
-        NSHTTPURLResponse* urlResponse =response;
+        NSHTTPURLResponse* urlResponse =(NSHTTPURLResponse*)response;
        NSData* data =[NSData dataWithContentsOfURL:location] ;
         NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
         if(data==nil)
@@ -1755,7 +1755,7 @@ repeat:
         
 
         
-        NSHTTPURLResponse* urlResponse =response;
+        NSHTTPURLResponse* urlResponse =(NSHTTPURLResponse*)response;
        NSData* data =[NSData dataWithContentsOfURL:location] ;
         NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
         if(data==nil)

+ 4 - 3
common/WK PDF+Web/RAPDFViewController.m

@@ -625,8 +625,8 @@
 //    if(self.attachment_name.length>0)
 //        filename = self.attachment_name;
     [mc addAttachmentData:data mimeType:@"application/pdf" fileName:filename];
-    [self presentModalViewController:mc animated:YES];
-    
+//    [self presentModalViewController:mc animated:YES];
+    [self presentViewController:mc animated:YES completion:nil];
     
     return;
 }
@@ -747,7 +747,8 @@
         default:
             break;
     }
-    [self dismissModalViewControllerAnimated:YES];
+//    [self dismissModalViewControllerAnimated:YES];
+    [self dismissViewControllerAnimated:YES completion:nil];
 }
 /*
 #pragma mark - Navigation