Преглед изворни кода

1.修改iOS Apex Mobile编译警告。

Pen Li пре 8 година
родитељ
комит
d3c79b71bb
45 измењених фајлова са 737 додато и 578 уклоњено
  1. 1 1
      Apex Mobile/AboutViewController.m
  2. 0 12
      Apex Mobile/Apex Mobile.xcodeproj/project.pbxproj
  3. 80 73
      Apex Mobile/Apex Mobile/AMResultViewController.m
  4. 1 1
      Apex Mobile/Apex Mobile/ApexHistoryViewController.m
  5. 11 10
      Apex Mobile/Apex Mobile/ApexMobileDB.m
  6. 19 5
      Apex Mobile/Apex Mobile/ApexMobileFirstViewController.m
  7. 1 1
      Apex Mobile/Apex Mobile/ApexMobileNavigationController.m
  8. 1 1
      Apex Mobile/Apex Mobile/AppDelegate.h
  9. 1 1
      Apex Mobile/Apex Mobile/AppDelegate.m
  10. 1 0
      Apex Mobile/Apex Mobile/CellItemHistory.m
  11. 45 15
      Apex Mobile/Apex Mobile/ChangePasswordViewController.m
  12. 13 6
      Apex Mobile/Apex Mobile/CustomizeFieldViewController.m
  13. 28 9
      Apex Mobile/Apex Mobile/DetailPageViewController.m
  14. 28 34
      Apex Mobile/Apex Mobile/DetailTabBarController.m
  15. 1 1
      Apex Mobile/Apex Mobile/DocumentsViewController.m
  16. 2 2
      Apex Mobile/Apex Mobile/FunctionSelectViewController.m
  17. 34 81
      Apex Mobile/Apex Mobile/GridResultViewController.m
  18. 1 1
      Apex Mobile/Apex Mobile/HistoryData.m
  19. 2 2
      Apex Mobile/Apex Mobile/HistoryTabBarController.m
  20. 1 1
      Apex Mobile/Apex Mobile/HistoryViewController.m
  21. 1 1
      Apex Mobile/Apex Mobile/LocalDocumentsViewController.m
  22. 1 1
      Apex Mobile/Apex Mobile/LocationViewController.h
  23. 27 27
      Apex Mobile/Apex Mobile/LocationViewController.m
  24. 23 6
      Apex Mobile/Apex Mobile/LoginViewController.m
  25. 1 1
      Apex Mobile/Apex Mobile/Main.storyboard
  26. 1 0
      Apex Mobile/Apex Mobile/MessageDetailItem.m
  27. 1 1
      Apex Mobile/Apex Mobile/MessageDetailViewController.m
  28. 1 0
      Apex Mobile/Apex Mobile/MessageItem.m
  29. 1 1
      Apex Mobile/Apex Mobile/MessageViewController.m
  30. 24 18
      Apex Mobile/Apex Mobile/MyAutocompleteView.m
  31. 1 1
      Apex Mobile/Apex Mobile/MylistViewController.m
  32. 1 1
      Apex Mobile/Apex Mobile/NewsDetailViewController.m
  33. 1 0
      Apex Mobile/Apex Mobile/NewsTableViewCell.m
  34. 2 2
      Apex Mobile/Apex Mobile/NewsViewController.m
  35. 15 11
      Apex Mobile/Apex Mobile/PieChart/XYRenderView.m
  36. 58 58
      Apex Mobile/Apex Mobile/PieChart/XYRotatedView.m
  37. 40 23
      Apex Mobile/Apex Mobile/PulldownMenu.m
  38. 37 29
      Apex Mobile/Apex Mobile/RANetwork.m
  39. 29 9
      Apex Mobile/Apex Mobile/RetrievePasswordViewController.m
  40. 1 1
      Apex Mobile/Apex Mobile/SearchTableAdapter.m
  41. 194 124
      Apex Mobile/Apex Mobile/SearchViewController.m
  42. 1 1
      Apex Mobile/Apex Mobile/TabBarController.m
  43. 1 1
      Apex Mobile/Apex Mobile/ToolsPanelViewController.m
  44. 1 1
      Apex Mobile/FavoritesViewController.m
  45. 3 3
      Apex Mobile/Launch.storyboard

+ 1 - 1
Apex Mobile/AboutViewController.m

@@ -32,7 +32,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }

+ 0 - 12
Apex Mobile/Apex Mobile.xcodeproj/project.pbxproj

@@ -1640,13 +1640,7 @@
 				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
-					/xcode_workspace/ERPSuiteIOS/Apex,
-					Mobile,
 					"$(PROJECT_DIR)",
-					"$(PROJECT_DIR)/Apex\\ Mobile/Google\\ Map",
-					"$(PROJECT_DIR)/Apex\\ Mobile/Google\\ Map",
-					"$(PROJECT_DIR)/Apex\\ Mobile/Google\\ Map",
-					"$(PROJECT_DIR)/GoogleMap",
 				);
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "Apex Mobile/Apex Mobile-Prefix.pch";
@@ -1683,13 +1677,7 @@
 				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
-					/xcode_workspace/ERPSuiteIOS/Apex,
-					Mobile,
 					"$(PROJECT_DIR)",
-					"$(PROJECT_DIR)/Apex\\ Mobile/Google\\ Map",
-					"$(PROJECT_DIR)/Apex\\ Mobile/Google\\ Map",
-					"$(PROJECT_DIR)/Apex\\ Mobile/Google\\ Map",
-					"$(PROJECT_DIR)/GoogleMap",
 				);
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "Apex Mobile/Apex Mobile-Prefix.pch";

+ 80 - 73
Apex Mobile/Apex Mobile/AMResultViewController.m

@@ -255,7 +255,7 @@
     self.email_subject = params[@"email_subject"];
     self.email_content = params[@"email_content"];
     
-    NSString *module_name = [self.params objectForKey:@"module_name"];
+//    NSString *module_name = [self.params objectForKey:@"module_name"];
     __weak typeof(self) weakSelf = self;
     
     // show alert
@@ -498,9 +498,47 @@
 }
 
 - (void)save {
-    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_create_tag", nil) message:NSLocalizedString(@"alert_msg_savehint", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) otherButtonTitles:NSLocalizedString(@"save", nil),nil];
-    alert.alertViewStyle = UIAlertViewStylePlainTextInput;
-    [alert show];
+    
+    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_create_tag", nil) message:NSLocalizedString(@"alert_msg_savehint", nil) preferredStyle:UIAlertControllerStyleAlert];
+    __block UITextField *inputTextField;
+    [alertVC addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
+        inputTextField = textField;
+    }];
+    
+    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"cancel", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        
+    }];
+    
+    UIAlertAction *saveAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"save", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        
+        UITextField * txt= inputTextField;
+        NSString* name = txt.text;
+        if(name.length==0)
+        {
+            [RAUtils message_alert:@"Name can not be empty." title:@"Save Search" controller:self];
+            return;
+        }
+        
+        NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self.params
+                                                           options:0
+                                                             error:nil];
+        NSString* param = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+        NSString* user = appDelegate.user;
+        
+        sqlite3 *db =[ApexMobileDB get_db];
+        NSString *module_name = [self.params objectForKey:@"module_name"];
+        
+        [ApexMobileDB execSql: [NSString stringWithFormat: @"insert into history(params,name,module_name,user) values('%@','%@','%@','%@')",param,name,module_name,user] db:db];
+        
+        sqlite3_close(db);
+        
+    }];
+    
+    [alertVC addAction:cancelAction];
+    [alertVC addAction:saveAction];
+    
+    [self presentViewController:alertVC animated:YES completion:nil];
 }
 
 - (void)fieldSetting {
@@ -612,37 +650,37 @@
     
     return [self share_activity];
     // 默认为保存,取保存路径
-    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
-    NSString *path = [paths objectAtIndex:0];
-    NSString *filePath = [path stringByAppendingPathComponent:[self.documentPath lastPathComponent]];
-    
-    // 没有保存的情况
-    if ([[NSFileManager defaultManager] fileExistsAtPath:self.documentPath]) {
-        filePath = self.documentPath;
-    }
-    NSURL *fileURL = [NSURL fileURLWithPath:filePath];
-    
-    if (self.documentController == nil) {
-        UIDocumentInteractionController *documentController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
-        documentController.delegate = self;
-        documentController.UTI = @"com.adobe.pdf";
-//        [documentController setName:@"abc test subject"];
-        self.documentController = documentController;
-    } else {
-        self.documentController.URL = fileURL;
-    }
-    self.documentController.annotation = @{@"recipt" : @[@"676034647@qq.com"],@"subject" : @"annotation subject",@"content" : @"annotation content"};
-//    self.documentController.name = @"Test";
-    
-//    [self.documentController setValue:@"test subject" forKey:@"subject"];
-    
-//    [self.documentController presentOpenInMenuFromRect:self.navigationController.topViewController.view.bounds
-//                                                inView:self.navigationController.topViewController.view
-//                                              animated:YES];
-    
-    [self.documentController presentOptionsMenuFromRect:self.navigationController.topViewController.view.bounds
-                                                 inView:self.navigationController.topViewController.view
-                                               animated:YES];
+//    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+//    NSString *path = [paths objectAtIndex:0];
+//    NSString *filePath = [path stringByAppendingPathComponent:[self.documentPath lastPathComponent]];
+//
+//    // 没有保存的情况
+//    if ([[NSFileManager defaultManager] fileExistsAtPath:self.documentPath]) {
+//        filePath = self.documentPath;
+//    }
+//    NSURL *fileURL = [NSURL fileURLWithPath:filePath];
+//
+//    if (self.documentController == nil) {
+//        UIDocumentInteractionController *documentController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
+//        documentController.delegate = self;
+//        documentController.UTI = @"com.adobe.pdf";
+////        [documentController setName:@"abc test subject"];
+//        self.documentController = documentController;
+//    } else {
+//        self.documentController.URL = fileURL;
+//    }
+//    self.documentController.annotation = @{@"recipt" : @[@"6666666@qq.com"],@"subject" : @"annotation subject",@"content" : @"annotation content"};
+////    self.documentController.name = @"Test";
+//
+////    [self.documentController setValue:@"test subject" forKey:@"subject"];
+//
+////    [self.documentController presentOpenInMenuFromRect:self.navigationController.topViewController.view.bounds
+////                                                inView:self.navigationController.topViewController.view
+////                                              animated:YES];
+//
+//    [self.documentController presentOptionsMenuFromRect:self.navigationController.topViewController.view.bounds
+//                                                 inView:self.navigationController.topViewController.view
+//                                               animated:YES];
 }
 
 -(void) share_activity
@@ -759,37 +797,6 @@
 
 #pragma mark - GridResult
 
-- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
-{
-    
-    if(buttonIndex!=alertView.cancelButtonIndex)
-    {
-        UITextField * txt=[alertView textFieldAtIndex:0];
-        NSString* name = txt.text;
-        if(name.length==0)
-        {
-            [RAUtils message_alert:@"Name can not be empty." title:@"Save Search" controller:self];
-            return;
-        }
-        
-        NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self.params
-                                                           options:0
-                                                             error:nil];
-        NSString* param = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
-        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-        NSString* user = appDelegate.user;
-        
-        sqlite3 *db =[ApexMobileDB get_db];
-        NSString *module_name = [self.params objectForKey:@"module_name"];
-        
-        [ApexMobileDB execSql: [NSString stringWithFormat: @"insert into history(params,name,module_name,user) values('%@','%@','%@','%@')",param,name,module_name,user] db:db];
-        
-        sqlite3_close(db);
-    }
-    
-    
-}
-
 - (NSArray*)getActions
 {
     DebugLog(@"getActions");
@@ -909,13 +916,13 @@
 }
 
 // Used to handle additional menu items that can be performed on the item specified by URL.  Currently only supports the "copy:", "print:" and "saveToCameraRoll:" actions.
-- (BOOL)documentInteractionController:(UIDocumentInteractionController *)controller canPerformAction:(nullable SEL)action {
-    return YES;
-}
-
-- (BOOL)documentInteractionController:(UIDocumentInteractionController *)controller performAction:(nullable SEL)action {
-    return YES;
-}
+//- (BOOL)documentInteractionController:(UIDocumentInteractionController *)controller canPerformAction:(nullable SEL)action {
+//    return YES;
+//}
+//
+//- (BOOL)documentInteractionController:(UIDocumentInteractionController *)controller performAction:(nullable SEL)action {
+//    return YES;
+//}
 
 @end
 

+ 1 - 1
Apex Mobile/Apex Mobile/ApexHistoryViewController.m

@@ -18,7 +18,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }

+ 11 - 10
Apex Mobile/Apex Mobile/ApexMobileDB.m

@@ -146,7 +146,7 @@
 {
     sqlite3* db = [self get_db ];
     NSMutableArray* ret = [[NSMutableArray alloc] init];
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     NSString* user = appDelegate.user;
     NSString *sqlQuery = [NSString stringWithFormat:@"select h_val from search_history where h_field='%@' and user='%@' order by h_time desc",field,user];
     sqlite3_stmt * statement;
@@ -175,7 +175,7 @@
 +(void) savehistory:(NSString*) field value:(NSString*) value
 {
     sqlite3* db = [self get_db ];
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     NSString* user = appDelegate.user;
     int _id = [self get_recordid:db table:@"search_history" where:[NSString stringWithFormat:@"user='%@' and h_field='%@' and h_val ='%@'",user,field,value]];
     if(_id>=0)
@@ -257,16 +257,17 @@
             NSString* alter_search_history = @"ALTER TABLE search_history ADD level INTEGER";
             [self execSql:alter_search_history db:db];
         }
-        NSTimeInterval time=[[NSDate date] timeIntervalSince1970];
-        double t = time-2592000;      //NSTimeInterval返回的是double类型
-        NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
-        [formatter setDateFormat:@"yyyy-MM-dd"];
-
-        NSString*timestr=[formatter stringFromDate:[NSDate dateWithTimeIntervalSince1970:t]];
-        
+//        NSTimeInterval time=[[NSDate date] timeIntervalSince1970];
+//        double t = time-2592000;      //NSTimeInterval返回的是double类型
+//        NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
+//        [formatter setDateFormat:@"yyyy-MM-dd"];
+//
+//        NSString*timestr=[formatter stringFromDate:[NSDate dateWithTimeIntervalSince1970:t]];
+//
     //    [self execSql:[NSString stringWithFormat:@"delete from search_history where h_time<%@",timestr ] db:db];
         [self execSql:@"delete from search_history where julianday('now', 'localtime')-julianday(h_time, 'localtime')>30" db:db];
-        int ret=sqlite3_close(db);
+        
+        sqlite3_close(db);
 //        int aaa = 0;
     }
     return YES;

+ 19 - 5
Apex Mobile/Apex Mobile/ApexMobileFirstViewController.m

@@ -33,9 +33,16 @@
     NSString*user = self.editUser.text;
     if(user.length==0||password.length==0)
     {
-        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_upcanotempty", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
-        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
-        [alert show];
+        
+        UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_upcanotempty", nil) preferredStyle:UIAlertControllerStyleAlert];
+        UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            
+        }];
+        
+        [alertVC addAction:action];
+        
+        [self presentViewController:alertVC animated:YES completion:nil];
+        
         return;
     }
      DebugLog(@"Login...   user= %@ ; password= %@",self.editUser.text,self.editPassword.text);
@@ -98,8 +105,15 @@
                         message=[NSString stringWithFormat:@"Failed to login code %d",ret];
                         break;
                 }
-                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_error", nil) message:message delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
-                [alert show];
+                
+                UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_error", nil) message:message preferredStyle:UIAlertControllerStyleAlert];
+                UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil)  style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                    
+                }];
+                
+                [alertVC addAction:action];
+                
+                [self presentViewController:alertVC animated:YES completion:nil];
             }
  
             

+ 1 - 1
Apex Mobile/Apex Mobile/ApexMobileNavigationController.m

@@ -44,7 +44,7 @@
 {
     return [[self topViewController] preferredInterfaceOrientationForPresentation];
 }
--(NSUInteger)supportedInterfaceOrientations
+-(UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     //    return UIInterfaceOrientationMaskLandscape;
     return [[self topViewController] supportedInterfaceOrientations];

+ 1 - 1
Apex Mobile/Apex Mobile/AppDelegate.h

@@ -7,7 +7,7 @@
 //
 
 #import <UIKit/UIKit.h>
-#import <GoogleMaps/GoogleMaps.h>
+//#import <GoogleMaps/GoogleMaps.h>
 
 UIKIT_EXTERN NSString * const APLogoutNotification;
 UIKIT_EXTERN NSString * const APPersonModeChangeNotification;

+ 1 - 1
Apex Mobile/Apex Mobile/AppDelegate.m

@@ -247,7 +247,7 @@ void UncaughtExceptionHandler(NSException *exception) {
 }
 
 - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)pToken {
-    NSString * sss=[NSString stringWithFormat:@"%@",pToken];
+//    NSString * sss=[NSString stringWithFormat:@"%@",pToken];
     self.duid = [[[[NSString stringWithFormat:@"%@",pToken] substringWithRange:NSMakeRange(0, 72)] substringWithRange:NSMakeRange(1, 71)] stringByReplacingOccurrencesOfString:@" " withString:@""];
     NSLog(@"regisger success:%@",pToken);
     

+ 1 - 0
Apex Mobile/Apex Mobile/CellItemHistory.m

@@ -21,6 +21,7 @@
 
 - (void)awakeFromNib
 {
+    [super awakeFromNib];
     // Initialization code
 }
 

+ 45 - 15
Apex Mobile/Apex Mobile/ChangePasswordViewController.m

@@ -28,7 +28,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }
@@ -53,20 +53,34 @@
     NSString* oldpass = self.editOld.text;
     NSString* newpass = self.editNew.text;
     NSString* confirmpass = self.editConfirm.text;
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     NSString* user = appDelegate.user;
     if(oldpass.length==0||oldpass.length==0||confirmpass.length==0)
     {
-        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_fieldscanotempty", nil)delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
-        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
-        [alert show];
+        
+        UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_fieldscanotempty", nil) preferredStyle:UIAlertControllerStyleAlert];
+        UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            
+        }];
+        
+        [alertVC addAction:action];
+        
+        [self presentViewController:alertVC animated:YES completion:nil];
+        
         return;
     }
     if(! [newpass isEqualToString:confirmpass])
     {
-        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_password_notequal", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
-        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
-        [alert show];
+        
+        UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_password_notequal", nil) preferredStyle:UIAlertControllerStyleAlert];
+        UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            
+        }];
+        
+        [alertVC addAction:action];
+        
+        [self presentViewController:alertVC animated:YES completion:nil];
+        
         return;
     }
     
@@ -86,19 +100,35 @@
             
             if (ret==RESULT_TRUE)
             {
-                 AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+                 AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
                 appDelegate.password = newpass;
                 [[NSUserDefaults standardUserDefaults] setValue:[AESCrypt encrypt:newpass password:@"usai"] forKey:@"password"];
                 
-                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_success", nil) message:NSLocalizedString(@"alert_msg_change_success", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
-                [alert show];
-//                [self.navigationController popViewControllerAnimated:true ];
-                [self dismissViewControllerAnimated:YES completion:nil];
+
+                [self dismissViewControllerAnimated:YES completion:^{
+                    
+                    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_success", nil) message:NSLocalizedString(@"alert_msg_change_success", nil)  preferredStyle:UIAlertControllerStyleAlert];
+                    UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                        
+                    }];
+                    
+                    [alertVC addAction:action];
+                    
+                    [appDelegate.window.rootViewController presentViewController:alertVC animated:YES completion:nil];
+                    
+                }];
             }
             else
             {
-                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_error", nil) message:[NSString stringWithFormat:NSLocalizedString(@"alert_msg_failed_change_password", nil),ret] delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
-                [alert show];
+                
+                UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_failed_change_password", nil) preferredStyle:UIAlertControllerStyleAlert];
+                UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                    
+                }];
+                
+                [alertVC addAction:action];
+                
+                [self presentViewController:alertVC animated:YES completion:nil];
             }
             
             

+ 13 - 6
Apex Mobile/Apex Mobile/CustomizeFieldViewController.m

@@ -27,7 +27,7 @@
     //    self.tableView.editing = true;
     self.displayfields = [[NSMutableArray alloc] init];
     self.hidefields = [[NSMutableArray alloc] init];
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     //    NSString* required_ver=[objheader objectForKey:@"client_ver"] ;
     //
     //    appDelegate.sessionid = [objheader valueForKey:@"sessionid"];
@@ -65,7 +65,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }
@@ -78,9 +78,16 @@
     if(self.displayfields.count<1)
         
     {
-        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_customizefield", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
-        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
-        [alert show];
+        
+        UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_customizefield", nil) preferredStyle:UIAlertControllerStyleAlert];
+        UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            
+        }];
+        
+        [alertVC addAction:action];
+        
+        [self presentViewController:alertVC animated:YES completion:nil];
+        
         return;
         
     }
@@ -89,7 +96,7 @@
         
         
         char *errorMsg;
-        AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
         if (sqlite3_exec(db, "BEGIN", NULL, NULL, &errorMsg)==SQLITE_OK) {
             
               DebugLog(@"begin transaction success");

+ 28 - 9
Apex Mobile/Apex Mobile/DetailPageViewController.m

@@ -413,13 +413,29 @@
     });
 }
 
-- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
-{
-//    [self.table beginUpdates];
-    [self.table reloadData];
-//    [self.table endUpdates];
+//- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
+//{
+////    [self.table beginUpdates];
+//    [self.table reloadData];
+////    [self.table endUpdates];
+//
+//}
+
+- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
     
+    __weak typeof(self) weakSelf = self;
+    [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext>  _Nonnull context) {
+        
+        // 动画前
+    } completion:^(id<UIViewControllerTransitionCoordinatorContext>  _Nonnull context) {
+        
+        // 动画后
+        [weakSelf.table reloadData];
+    }];
+    
+    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
 }
+
 //// 是否支持屏幕旋转
 //- (BOOL)shouldAutorotate {
 //
@@ -736,7 +752,7 @@
         CGSize calkeysize= [keylabel sizeThatFits:constraintkey];
         if([key isEqualToString:@"Place_Of_Delivery"])
         {
-            int abc=0;
+//            int abc=0;
         }
 //        [keylabel sizeToFit];
 //        CGRect r = keylabel.frame;
@@ -899,8 +915,10 @@
         //        frame.origin.y=0;
         
         
-        CGSize sizeText = [text sizeWithFont:[UIFont systemFontOfSize:13.0] constrainedToSize:constraintval lineBreakMode:NSLineBreakByWordWrapping];
+//        CGSize sizeText = [text sizeWithFont:[UIFont systemFontOfSize:13.0] constrainedToSize:constraintval lineBreakMode:NSLineBreakByWordWrapping];
         //           CGSize sizeval = [val sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintval lineBreakMode:NSLineBreakByWordWrapping];
+        
+        CGSize sizeText = [text boundingRectWithSize:constraintval options:(NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading) attributes: @{NSFontAttributeName: [UIFont systemFontOfSize:13.0]} context:nil].size;
         float height = sizeText.height;
         height = MAX(height+LINE_WIDTH, DEF_CELL_HEIGHT);
         return height;
@@ -1137,7 +1155,7 @@
         
         if([key isEqualToString:@"Place_Of_Delivery"])
         {
-            int abc=0;
+//            int abc=0;
         }
         
         NSLog(@"key %@ val %@",key,val);
@@ -1344,8 +1362,9 @@
         
         
         
-        CGSize sizeval = [val sizeWithFont:[UIFont systemFontOfSize:13.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+//        CGSize sizeval = [val sizeWithFont:[UIFont systemFontOfSize:13.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
         
+        CGSize sizeval = [val boundingRectWithSize:constraintkey options:(NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading) attributes: @{NSFontAttributeName: [UIFont systemFontOfSize:13.0]} context:nil].size;
         
         float height = sizeval.height;
         height = MAX(height, DEF_CELL_HEIGHT-LINE_WIDTH);

+ 28 - 34
Apex Mobile/Apex Mobile/DetailTabBarController.m

@@ -157,58 +157,52 @@
     return self;
 }
 
-- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
+-(void)saveDetail:(UIBarButtonItem*)sender
 {
     
-    if(buttonIndex!=alertView.cancelButtonIndex)
-    {
-        UITextField * txt=[alertView textFieldAtIndex:0];
+    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_create_tag", nil) message:NSLocalizedString(@"alert_msg_savehint", nil) preferredStyle:UIAlertControllerStyleAlert];
+    
+    __block UITextField *inputTextField = nil;
+    [alertVC addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
+        inputTextField = textField;
+    }];
+    
+    __weak typeof(self) weakSelf = self;
+    UIAlertAction *saveAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"save", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        
+        UITextField * txt= inputTextField;
         NSString* name = txt.text;
         if(name.length==0)
         {
-            [RAUtils message_alert:@"Name can not be empty." title:@"Save Detail" controller:self];
+            [RAUtils message_alert:@"Name can not be empty." title:@"Save Detail" controller:weakSelf];
             return;
         }
         
-        NSString * actions = [self.actions componentsJoinedByString:@","];
-//        NSString* param = [self.params description];
+        NSString * actions = [weakSelf.actions componentsJoinedByString:@","];
         
         NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self.params
                                                            options:0
                                                              error:nil];
         NSString* param = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
-//        NSData *myData = [NSKeyedArchiver archivedDataWithRootObject:self.params];
-//        
-//        NSString* param = [[NSString alloc] initWithData:myData
-//                                                encoding:NSUTF8StringEncoding];
-        AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
         NSString* user = appDelegate.user;
         
         sqlite3 *db =[ApexMobileDB get_db];
         
-        [ApexMobileDB execSql: [NSString stringWithFormat: @"insert into favorites(params,name,module_name,user,action) values('%@','%@','%@','%@','%@')",param,name,self.function_name,user,actions] db:db];
+        [ApexMobileDB execSql: [NSString stringWithFormat: @"insert into favorites(params,name,module_name,user,action) values('%@','%@','%@','%@','%@')",param,name,weakSelf.function_name,user,actions] db:db];
         
         sqlite3_close(db);
         
-     
-        
-    }
-    
-    
-}
-
--(void)saveDetail:(UIBarButtonItem*)sender
-{
-    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_create_tag", nil) message:NSLocalizedString(@"alert_msg_savehint", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) otherButtonTitles:NSLocalizedString(@"save", nil),nil];
-    alert.alertViewStyle = UIAlertViewStylePlainTextInput;
+    }];
     
-    UITextField * txt = [[UITextField alloc] init];
+    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"cancel", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        
+    }];
     
-    txt.backgroundColor = [UIColor yellowColor];
+    [alertVC addAction:cancelAction];
+    [alertVC addAction:saveAction];
     
-    txt.frame = CGRectMake(alert.center.x+65,alert.center.y+48, 150,23);
-    //        [alert addSubview:txt];
-    [alert show];
+    [self presentViewController:alertVC animated:YES completion:nil];
 }
 
 - (void)closeClick:(id)sender {
@@ -295,7 +289,7 @@
     [saveBtn setImage:[UIImage imageNamed:@"ic_save"] forState:UIControlStateNormal];
     //    [saveBtn setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, -15)]; // 右移
     [saveBtn addTarget:self action:@selector(saveDetail:) forControlEvents:UIControlEventTouchUpInside];
-    UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithCustomView:saveBtn];
+//    UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithCustomView:saveBtn];
     
     UIBarButtonItem *fixBtn = [[UIBarButtonItem alloc] initWithTitle:nil style:UIBarButtonItemStylePlain target:nil action:nil];
     fixBtn.width = 0;
@@ -358,7 +352,7 @@
     NSString *content = [pageVC.content.originContent objectForKey:@"email_content"];
     
 //    content = @"Test Body";
-    NSArray *activityItems = nil;
+//    NSArray *activityItems = nil;
 //    if (content) {
         
         
@@ -382,9 +376,9 @@
     
 //    content write
     
-    NSString *textToShare = content;
-    UIImage *imageToShare = [UIImage imageNamed:@"AppIcon"];
-    NSURL *urlToShare = [NSURL URLWithString:@"http://baidu.com"];
+//    NSString *textToShare = content;
+//    UIImage *imageToShare = [UIImage imageNamed:@"AppIcon"];
+//    NSURL *urlToShare = [NSURL URLWithString:@"http://baidu.com"];
 //activityItems = @[urlToShare,textToShare,imageToShare];
     
     LPShareActivity *share = [[LPShareActivity alloc] init];

+ 1 - 1
Apex Mobile/Apex Mobile/DocumentsViewController.m

@@ -70,7 +70,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }

+ 2 - 2
Apex Mobile/Apex Mobile/FunctionSelectViewController.m

@@ -155,7 +155,7 @@
     
 }
 - (IBAction)onExit:(UIButton *)sender {
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     [appDelegate Logout];
     [self performSegueWithIdentifier:@"LOGIN" sender:self];
 
@@ -171,7 +171,7 @@
     [[self view] endEditing:YES];
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }

+ 34 - 81
Apex Mobile/Apex Mobile/GridResultViewController.m

@@ -69,7 +69,7 @@
                 self.nextpageButton.enabled=true;
             [self.grid initgrid :self.pageData];
             
-            CGPoint p = self.grid.frame.origin;
+//            CGPoint p = self.grid.frame.origin;
             
             
             self.mum.hidden = true;
@@ -107,10 +107,6 @@
     //        detailViewController.params =params;
     [self.navigationController pushViewController:detailViewController animated:YES];
     
-    //(int)Authorize : (NSString*) user password:(NSString*) password
-    
-    //    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"1111" message:@"1111" delegate:self cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles: nil];
-    //    [alert show];
 }
 - (BOOL)canPerformAction:(SEL)action withSender:(id)sender
 {
@@ -136,88 +132,45 @@
     }
     else
     {
-        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_create_tag", nil) message:NSLocalizedString(@"alert_msg_savehint", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) otherButtonTitles:NSLocalizedString(@"save", nil),nil];
-        alert.alertViewStyle = UIAlertViewStylePlainTextInput;
-        
-        UITextField * txt = [[UITextField alloc] init];
         
-        txt.backgroundColor = [UIColor yellowColor];
+        UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_create_tag", nil) message:NSLocalizedString(@"alert_msg_savehint", nil) preferredStyle:UIAlertControllerStyleAlert];
         
-        txt.frame = CGRectMake(alert.center.x+65,alert.center.y+48, 150,23);
-        //        [alert addSubview:txt];
-        [alert show];
+        __block UITextField *inputTextField;
+        [alertVC addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
+            inputTextField = textField;
+        }];
         
-    }
-}
-- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
-{
-    
-    if(buttonIndex!=alertView.cancelButtonIndex)
-    {
-        UITextField * txt=[alertView textFieldAtIndex:0];
-        NSString* name = txt.text;
-        NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self.params
-                                                           options:0
-                                                             error:nil];
-        NSString* param = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
-        AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
-        NSString* user = appDelegate.user;
-        
-        sqlite3 *db =[ApexMobileDB get_db];
+        UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"cancel", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            
+        }];
         
-        [ApexMobileDB execSql: [NSString stringWithFormat: @"insert into history(params,name,module_name,user) values('%@','%@','%@','%@')",param,name,self.function_name,user] db:db];
+        UIAlertAction *saveAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"save", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            
+            UITextField * txt= inputTextField;
+            NSString* name = txt.text;
+            NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self.params
+                                                               options:0
+                                                                 error:nil];
+            NSString* param = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+            AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+            NSString* user = appDelegate.user;
+            
+            sqlite3 *db =[ApexMobileDB get_db];
+            
+            [ApexMobileDB execSql: [NSString stringWithFormat: @"insert into history(params,name,module_name,user) values('%@','%@','%@','%@')",param,name,self.function_name,user] db:db];
+            
+            sqlite3_close(db);
+            
+        }];
         
-        sqlite3_close(db);
+        [alertVC addAction:cancelAction];
+        [alertVC addAction:saveAction];
         
-        //NSString *jsonString =
-        /*
-         String name = ((EditText) edit)
-         .getText().toString();
-         String param = getIntent().toUri(0);
-         
-         JSONObject obj = new JSONObject();
-         Set<String> keys = searchParms.keySet();
-         for (String key : keys)
-         {
-         
-         
-         try
-         {
-         obj.put(key, searchParms.get(key).toString());
-         
-         }
-         catch (JSONException e)
-         {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-         }
-         
-         }
-         obj.toString();
-         
-         SQLiteDatabase db = dbUtil.OpenDB(
-         ApexTrackingApplication.get_instance(), null, true);
-         db.execSQL("insert into history(params,name,criterion,module_name,user,create_time) values('"
-         
-         + param
-         + "','"
-         + name
-         + "','"
-         + obj.toString()
-         + "','"
-         + function_name
-         + "','"
-         + ApexTrackingApplication.get_user()
-         + "',"
-         + System.currentTimeMillis() + ")");
-         dbUtil.CloseDB(db);
-         
-         */
+        [self presentViewController:alertVC animated:YES completion:nil];
         
     }
-    
-    
 }
+
 -(void)pullDownAnimated:(BOOL)open
 {
     if (open)
@@ -234,7 +187,7 @@
     
     
     
-    CGRect ff = self.navigationController.navigationBar.frame;
+//    CGRect ff = self.navigationController.navigationBar.frame;
     //    : CGPointMake(0.0f,self.navigationController.navigationBar.frame.size.height)
     
     [pulldownMenu animateDropDown:CGPointMake(0.0f,self.navigationController.navigationBar.frame.size.height)];
@@ -294,7 +247,7 @@
 {
     DebugLog(@"getActions");
     
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     
     
     NSMutableArray* actions = [[NSMutableArray alloc]init];
@@ -327,7 +280,7 @@
     //    NSMutableDictionary* header = [[NSMutableDictionary alloc] init];
     //    [header setValue:@"aaa" forKey:@"bbb"];
     DebugLog(@"initHeader");
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     
     sqlite3 *db =[ApexMobileDB get_db];
     NSString *quary = [NSString stringWithFormat:@"select aname,name from fields_info where function_name='%@' and user='%@' and behavior=%d and show=1 order by priority,aname",self.function_name, appDelegate.user,BEHAVIOR_RESULT];

+ 1 - 1
Apex Mobile/Apex Mobile/HistoryData.m

@@ -21,7 +21,7 @@
     if (self) {
         self.pagedata =[[NSMutableArray alloc]init];
         
-        AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
         //    NSString* required_ver=[objheader objectForKey:@"client_ver"] ;
         //
         //    appDelegate.sessionid = [objheader valueForKey:@"sessionid"];

+ 2 - 2
Apex Mobile/Apex Mobile/HistoryTabBarController.m

@@ -27,7 +27,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }
@@ -71,7 +71,7 @@
         
         
         
-        NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
+//        NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
         
         
         

+ 1 - 1
Apex Mobile/Apex Mobile/HistoryViewController.m

@@ -28,7 +28,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }

+ 1 - 1
Apex Mobile/Apex Mobile/LocalDocumentsViewController.m

@@ -26,7 +26,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }

+ 1 - 1
Apex Mobile/Apex Mobile/LocationViewController.h

@@ -15,7 +15,7 @@
 #import <Contacts/Contacts.h>
 #import <ContactsUI/ContactsUI.h>
 
-@interface LocationViewController : UIViewController<GMSMapViewDelegate,CNContactViewControllerDelegate>
+@interface LocationViewController : UIViewController<CNContactViewControllerDelegate>
 //@interface LocationViewController : UIViewController<GMSMapViewDelegate,CNContactViewControllerDelegate>
 
 @property (strong,nonatomic) NSMutableDictionary * params;

+ 27 - 27
Apex Mobile/Apex Mobile/LocationViewController.m

@@ -50,7 +50,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }
@@ -251,34 +251,34 @@
 //    [self addLocation];
 }
 
-- (void)mapView:(GMSMapView *)mapView
-didTapInfoWindowOfMarker:(GMSMarker *)marker
-{
-    DebugLog(@"tap info window");
-    //    id ud = marker.userData;
-    self.params = marker.userData;
-    
-//    [self addUnknown];
-    [self showUnknown];
-    
-//    LocationDetailViewController *ViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"LocationDetailViewController"];
-//    ViewController.params = self.params;
-//    self.aBNewPersonNav = [[UINavigationController alloc] initWithRootViewController:ViewController] ;
-//    [self presentViewController:self.aBNewPersonNav animated:YES completion:^{
-//        
-//    }];
-    
-    
-//    [self presentViewController:self.aBNewPersonNav animated:YES];
-
-    
-//
+//- (void)mapView:(GMSMapView *)mapView
+//didTapInfoWindowOfMarker:(GMSMarker *)marker
+//{
+//    DebugLog(@"tap info window");
+//    //    id ud = marker.userData;
+//    self.params = marker.userData;
+//    
+////    [self addUnknown];
+//    [self showUnknown];
+//    
+////    LocationDetailViewController *ViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"LocationDetailViewController"];
+////    ViewController.params = self.params;
+////    self.aBNewPersonNav = [[UINavigationController alloc] initWithRootViewController:ViewController] ;
+////    [self presentViewController:self.aBNewPersonNav animated:YES completion:^{
+////        
+////    }];
+//    
 //    
+////    [self presentViewController:self.aBNewPersonNav animated:YES];
 //
-//    [self.navigationController pushViewController:ViewController animated:YES];
-//    [self performSegueWithIdentifier:@"DETAIL" sender:self];
-    
-}
+//    
+////
+////    
+////
+////    [self.navigationController pushViewController:ViewController animated:YES];
+////    [self performSegueWithIdentifier:@"DETAIL" sender:self];
+//    
+//}
 //- (void)addUnknown
 //{
 //

+ 23 - 6
Apex Mobile/Apex Mobile/LoginViewController.m

@@ -39,9 +39,17 @@
     NSString*user = self.editUser.text;
     if(user.length==0||password.length==0)
     {
-        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_upcanotempty", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
-        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
-        [alert show];
+        
+        UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_upcanotempty", nil) preferredStyle:UIAlertControllerStyleAlert];
+        UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            
+        }];
+        
+        [alertVC addAction:action];
+        
+        [self presentViewController:alertVC animated:YES completion:nil];
+        
+        
         return;
     }
     DebugLog(@"Login...   user= %@ ; password= %@",self.editUser.text,self.editPassword.text);
@@ -49,11 +57,13 @@
     
     self.loginButton.enabled = false;
     self.mum.hidden=false;
+    NSString *request_user = self.editUser.text.lowercaseString;
+    NSString *request_password = self.editPassword.text;
     
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         
         
-        int ret=[RANetwork Authorize:self.editUser.text.lowercaseString password:self.editPassword.text];
+        int ret=[RANetwork Authorize:request_user password:request_password];
         
         dispatch_async(dispatch_get_main_queue(), ^{
             self.mum.hidden=true;
@@ -107,8 +117,15 @@
                         message=[NSString stringWithFormat:@"Failed to login code %d",ret];
                         break;
                 }
-                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_error", nil) message:message delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
-                [alert show];
+                
+                UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_error", nil) message:message preferredStyle:UIAlertControllerStyleAlert];
+                UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                    
+                }];
+                
+                [alertVC addAction:action];
+                
+                [self presentViewController:alertVC animated:YES completion:nil];
             }
             
             

+ 1 - 1
Apex Mobile/Apex Mobile/Main.storyboard

@@ -14,7 +14,7 @@
         <!--Navigation Controller-->
         <scene sceneID="n3W-k5-9pt">
             <objects>
-                <navigationController id="YOs-rL-bRV" sceneMemberID="viewController">
+                <navigationController storyboardIdentifier="root_nav" useStoryboardIdentifierAsRestorationIdentifier="YES" id="YOs-rL-bRV" sceneMemberID="viewController">
                     <navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="Cv3-js-Kre">
                         <rect key="frame" x="0.0" y="20" width="375" height="44"/>
                         <autoresizingMask key="autoresizingMask"/>

+ 1 - 0
Apex Mobile/Apex Mobile/MessageDetailItem.m

@@ -21,6 +21,7 @@
 
 - (void)awakeFromNib
 {
+    [super awakeFromNib];
     // Initialization code
 }
 

+ 1 - 1
Apex Mobile/Apex Mobile/MessageDetailViewController.m

@@ -37,7 +37,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }

+ 1 - 0
Apex Mobile/Apex Mobile/MessageItem.m

@@ -21,6 +21,7 @@
 
 - (void)awakeFromNib
 {
+    [super awakeFromNib];
     // Initialization code
 }
 

+ 1 - 1
Apex Mobile/Apex Mobile/MessageViewController.m

@@ -32,7 +32,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }

+ 24 - 18
Apex Mobile/Apex Mobile/MyAutocompleteView.m

@@ -113,7 +113,7 @@ parentView:(UIView*) view
     }
 
     CGPoint textPosition = [_queryTextField convertPoint:_queryTextField.bounds.origin toView:_parentView]; //Taking in account Y position of queryTextField relatively to it's Window
-    CGRect textfieldFrame = _queryTextField.frame;
+//    CGRect textfieldFrame = _queryTextField.frame;
     CGFloat calculatedY = textPosition.y + _queryTextField.frame.size.height + self.topMargin;
     CGFloat calculatedHeight = 130;//150;//contextViewHeight - calculatedY - kbHeight;
 
@@ -136,26 +136,32 @@ parentView:(UIView*) view
 {
     if ([_queryTextField.text length] >= _itemsSource.minimumCharactersToTrigger)
     {
+        __weak typeof(self) weakSelf = self;
         [_itemsSource itemsFor:_queryTextField.text whenReady:
                                                             ^(NSArray *suggestions)
                                                             {
-                                                                if (_queryTextField.text.length
-                                                                    < _itemsSource.minimumCharactersToTrigger)
-                                                                {
-                                                                    self.suggestions = nil;
-                                                                    [_table reloadData];
-                                                                }
-                                                                else
-                                                                {
-                                                                    self.suggestions = suggestions;
-                                                                    [_table reloadData];
-
-                                                                    if (self.suggestions.count > 0 && !_visible)
+                                                                
+                                                                if (weakSelf) {
+                                                                    __strong typeof(weakSelf) strongSelf = weakSelf;
+                                                                    
+                                                                    if (strongSelf->_queryTextField.text.length
+                                                                        < strongSelf->_itemsSource.minimumCharactersToTrigger)
                                                                     {
-                                                                        [_parentView addSubview:self];
-//                                                                        [_contextController.view addSubview:self];
-                                                                        CGRect r= self.frame;
-                                                                        _visible = YES;
+                                                                        strongSelf.suggestions = nil;
+                                                                        [strongSelf->_table reloadData];
+                                                                    }
+                                                                    else
+                                                                    {
+                                                                        strongSelf.suggestions = suggestions;
+                                                                        [strongSelf->_table reloadData];
+                                                                        
+                                                                        if (strongSelf.suggestions.count > 0 && !strongSelf->_visible)
+                                                                        {
+                                                                            [strongSelf->_parentView addSubview:self];
+                                                                            //                                                                        [_contextController.view addSubview:self];
+//                                                                            CGRect r= self.frame;
+                                                                            strongSelf->_visible = YES;
+                                                                        }
                                                                     }
                                                                 }
                                                             }];
@@ -223,4 +229,4 @@ parentView:(UIView*) view
                                    object:nil];
 }
 
-@end
+@end

+ 1 - 1
Apex Mobile/Apex Mobile/MylistViewController.m

@@ -136,7 +136,7 @@
     {
 
         
-        AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
         [appDelegate Logout];
         if(self.logoutSuccessful)
             self.logoutSuccessful();

+ 1 - 1
Apex Mobile/Apex Mobile/NewsDetailViewController.m

@@ -43,7 +43,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }

+ 1 - 0
Apex Mobile/Apex Mobile/NewsTableViewCell.m

@@ -21,6 +21,7 @@
 
 - (void)awakeFromNib
 {
+    [super awakeFromNib];
     // Initialization code
 }
 

+ 2 - 2
Apex Mobile/Apex Mobile/NewsViewController.m

@@ -21,7 +21,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }
@@ -74,7 +74,7 @@
                 if(self.data.finishload==true)
                 {
                     
-                    int i =self.btnrefresh.state;
+//                    int i =self.btnrefresh.state;
                     self.btnrefresh.titleLabel.text =NSLocalizedString(@"no_more",nil);
                     //                    [self.btnrefresh setTitle:@"No more" forState:UIControlStateNormal];
                 }

+ 15 - 11
Apex Mobile/Apex Mobile/PieChart/XYRenderView.m

@@ -348,22 +348,24 @@ static CGPathRef CGPathCreateArc(CGPoint center, CGFloat radius, CGFloat startAn
         [_pieView setUserInteractionEnabled:NO];
         
         __block NSMutableArray *layersToRemove = nil;
+        __weak typeof(self) weakSelf = self;
         [CATransaction setCompletionBlock:^{
             
             [layersToRemove enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
                 [obj removeFromSuperlayer];
             }];
+            __strong typeof(weakSelf) strongSelf = weakSelf;
             
             [layersToRemove removeAllObjects];
             
-            for(SliceLayer *layer in _pieView.layer.sublayers)
+            for(SliceLayer *layer in strongSelf->_pieView.layer.sublayers)
             {
                 [layer setZPosition:kDefaultSliceZOrder];
             }
             
-            [_pieView setUserInteractionEnabled:YES];
-            if([_delegate respondsToSelector:@selector(animateFinish:)]){
-                [_delegate animateFinish:self];
+            [strongSelf->_pieView setUserInteractionEnabled:YES];
+            if([strongSelf.delegate respondsToSelector:@selector(animateFinish:)]){
+                [strongSelf.delegate animateFinish:self];
             }
         }];
         
@@ -522,22 +524,24 @@ static CGPathRef CGPathCreateArc(CGPoint center, CGFloat radius, CGFloat startAn
     CALayer *parentLayer = [_pieView layer];
     NSArray *pieLayers = [parentLayer sublayers];
     
+    __weak typeof(self) weakSelf = self;
     [pieLayers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
         SliceLayer *layer = (SliceLayer *)obj;
         
+        __strong typeof(weakSelf) strongSelf = weakSelf;
         NSNumber *presentationLayerStartAngle = [[obj presentationLayer] valueForKey:@"startAngle"];
         CGFloat interpolatedStartAngle = [presentationLayerStartAngle doubleValue];
         
         NSNumber *presentationLayerEndAngle = [[obj presentationLayer] valueForKey:@"endAngle"];
         CGFloat interpolatedEndAngle = [presentationLayerEndAngle doubleValue];
         
-        CGPathRef path = CGPathCreateArc(_pieCenter, _pieRadius, interpolatedStartAngle, interpolatedEndAngle);
+        CGPathRef path = CGPathCreateArc(strongSelf.pieCenter, strongSelf.pieRadius, interpolatedStartAngle, interpolatedEndAngle);
         [obj setPath:path];
         CFRelease(path);
         
         {
             CATextLayer *labelLayer = (CATextLayer*)[[obj sublayers] objectAtIndex:0];
-            CAShapeLayer *lineLayer = (CAShapeLayer*)[[obj sublayers] objectAtIndex:1];
+//            CAShapeLayer *lineLayer = (CAShapeLayer*)[[obj sublayers] objectAtIndex:1];
             CGFloat interpolatedMidAngle = (interpolatedEndAngle + interpolatedStartAngle) / 2;
             [CATransaction setDisableActions:YES];
             
@@ -570,9 +574,9 @@ static CGPathRef CGPathCreateArc(CGPoint center, CGFloat radius, CGFloat startAn
 //                [labelLayer setPosition:CGPointMake(labelLayerX * 1, labelLayerY * 1)];
             } else {
 
-                float labelLayerX = _pieCenter.x + (_labelRadius * cos(interpolatedMidAngle));
+                float labelLayerX = strongSelf.pieCenter.x + (strongSelf.labelRadius * cos(interpolatedMidAngle));
 
-                float labelLayerY = _pieCenter.y + (_labelRadius * sin(interpolatedMidAngle));
+                float labelLayerY = strongSelf.pieCenter.y + (strongSelf.labelRadius * sin(interpolatedMidAngle));
 
                 [labelLayer setPosition:CGPointMake(labelLayerX * 1, labelLayerY * 1)];
 
@@ -620,13 +624,13 @@ static CGPathRef CGPathCreateArc(CGPoint center, CGFloat radius, CGFloat startAn
     
     CALayer *parentLayer = [_pieView layer];
     NSArray *pieLayers = [parentLayer sublayers];
-    
+    __weak typeof(self) weakSelf = self;
     [pieLayers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
         SliceLayer *pieLayer = (SliceLayer *)obj;
         CGPathRef path = [pieLayer path];
-        
+        __strong typeof(weakSelf) strongSelf = weakSelf;
         if (CGPathContainsPoint(path, &transform, point, 0)) {
-            [pieLayer setLineWidth:_selectedSliceStroke];
+            [pieLayer setLineWidth:strongSelf.selectedSliceStroke];
             [pieLayer setStrokeColor:[UIColor whiteColor].CGColor];
             [pieLayer setLineJoin:kCALineJoinBevel];
             [pieLayer setZPosition:MAXFLOAT];

+ 58 - 58
Apex Mobile/Apex Mobile/PieChart/XYRotatedView.m

@@ -203,42 +203,42 @@
 
 - (void)delayAnimate {
     return ;
-    double tan2 = atan2(self.transform.b, self.transform.a);
-    
-    //根据旋转角度判断当前在那个扇区中
-    float curTheta = M_PI_2/2 - tan2;
-    curTheta = curTheta > 0?curTheta:M_PI*2+curTheta;
-    int selIndex = 0;
-    for (;selIndex < [_mThetaArray count]; selIndex++) {
-        if (curTheta < [[_mThetaArray objectAtIndex:selIndex] floatValue]) {
-            break;
-        }
-    }
-    
-    //根据当前旋转弧度和选中扇区的起止弧度,判断居中需要旋转的弧度
-    float calTheta = [[_mThetaArray objectAtIndex:selIndex] floatValue] - curTheta;
-    float fanTheta = [[_percentArray objectAtIndex:selIndex] floatValue] * self.fracValue;
-    float rotateTheta = fanTheta/2 - calTheta;
-    
-    //设置动画 选中后扇形外滑的动画
-    [UIView animateWithDuration:0.42 animations:^{
-        
-        self.transform = CGAffineTransformRotate(self.transform,rotateTheta);
-        self.pieChart.textAngle = rotateTheta;
-        
-    } completion:^(BOOL finished) {
-        
-            [self outPie];
-    }];
-    
-        [self delayAnimateStop:selIndex];
+//    double tan2 = atan2(self.transform.b, self.transform.a);
+//
+//    //根据旋转角度判断当前在那个扇区中
+//    float curTheta = M_PI_2/2 - tan2;
+//    curTheta = curTheta > 0?curTheta:M_PI*2+curTheta;
+//    int selIndex = 0;
+//    for (;selIndex < [_mThetaArray count]; selIndex++) {
+//        if (curTheta < [[_mThetaArray objectAtIndex:selIndex] floatValue]) {
+//            break;
+//        }
+//    }
+//
+//    //根据当前旋转弧度和选中扇区的起止弧度,判断居中需要旋转的弧度
+//    float calTheta = [[_mThetaArray objectAtIndex:selIndex] floatValue] - curTheta;
+//    float fanTheta = [[_percentArray objectAtIndex:selIndex] floatValue] * self.fracValue;
+//    float rotateTheta = fanTheta/2 - calTheta;
+//
+//    //设置动画 选中后扇形外滑的动画
+//    [UIView animateWithDuration:0.42 animations:^{
+//
+//        self.transform = CGAffineTransformRotate(self.transform,rotateTheta);
+//        self.pieChart.textAngle = rotateTheta;
+//
+//    } completion:^(BOOL finished) {
+//
+//            [self outPie];
+//    }];
+//
+//        [self delayAnimateStop:selIndex];
 }
 -(void) highlightPie:(int) index
 {
     [self.pieChart pieHightlight:index];
 }
 - (void)outPie {
-    NSLog(@"out pie %@",self.selectedIndex);
+    NSLog(@"out pie %ld",self.selectedIndex);
     [self.pieChart pieSelected:self.selectedIndex];
     self.canLayerOpen = YES;
 }
@@ -277,34 +277,34 @@
 #pragma mark - 点击结束,触发旋转方法
 - (void)tapStopped {
     return;
-    int tapAreaIndex = [self touchIndex];
-    
-    if (tapAreaIndex == 0) {
-        _mRelativeTheta = [[_mThetaArray objectAtIndex:0] floatValue] / 2;
-    } else {
-        _mRelativeTheta = [[_mThetaArray objectAtIndex:tapAreaIndex] floatValue]
-        - (([[_mThetaArray objectAtIndex:tapAreaIndex] floatValue]
-            - [[_mThetaArray objectAtIndex:tapAreaIndex - 1] floatValue]) / 2);
-    }
-    self.pieChart.textrelativeTheta = _mRelativeTheta;
-    if (tapAreaIndex != self.selectedIndex) {
-        if (self.canLayerOpen) {
-            [self.pieChart pieSelected:self.selectedIndex];
-            self.canLayerOpen = NO;
-        }
-        _isAutoRotation = YES;
-        [UIView beginAnimations:@"tap stopped" context:nil];
-        
-#pragma mark- 点击旋转速度
-        [UIView setAnimationDuration:0.5];
-        [UIView setAnimationDelegate:self];
-        [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
-        self.pieChart.textAngle = [self rotationThetaForNewTheta:K_POINTER_ANGLE];
-        self.transform = CGAffineTransformMakeRotation([self rotationThetaForNewTheta:K_POINTER_ANGLE]);
-        [UIView commitAnimations];
-    }
-    
-    return;
+//    int tapAreaIndex = [self touchIndex];
+//
+//    if (tapAreaIndex == 0) {
+//        _mRelativeTheta = [[_mThetaArray objectAtIndex:0] floatValue] / 2;
+//    } else {
+//        _mRelativeTheta = [[_mThetaArray objectAtIndex:tapAreaIndex] floatValue]
+//        - (([[_mThetaArray objectAtIndex:tapAreaIndex] floatValue]
+//            - [[_mThetaArray objectAtIndex:tapAreaIndex - 1] floatValue]) / 2);
+//    }
+//    self.pieChart.textrelativeTheta = _mRelativeTheta;
+//    if (tapAreaIndex != self.selectedIndex) {
+//        if (self.canLayerOpen) {
+//            [self.pieChart pieSelected:self.selectedIndex];
+//            self.canLayerOpen = NO;
+//        }
+//        _isAutoRotation = YES;
+//        [UIView beginAnimations:@"tap stopped" context:nil];
+//
+//#pragma mark- 点击旋转速度
+//        [UIView setAnimationDuration:0.5];
+//        [UIView setAnimationDelegate:self];
+//        [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
+//        self.pieChart.textAngle = [self rotationThetaForNewTheta:K_POINTER_ANGLE];
+//        self.transform = CGAffineTransformMakeRotation([self rotationThetaForNewTheta:K_POINTER_ANGLE]);
+//        [UIView commitAnimations];
+//    }
+//
+//    return;
 }
 
 #pragma mark -

+ 40 - 23
Apex Mobile/Apex Mobile/PulldownMenu.m

@@ -203,48 +203,65 @@
 - (void)animateDropDown
 {
     
+    __weak typeof(self) weakSelf = self;
     [UIView animateWithDuration: animationDuration
                           delay: 0.0
                         options: UIViewAnimationOptionCurveEaseOut
                      animations:^{
-                         if (fullyOpen)
-                         {
-                             
-                             self.center = CGPointMake(self.frame.size.width / 2, -((self.frame.size.height / 2) + topMargin));
-                             fullyOpen = NO;
-                         }
-                         else
-                         {
-                             self.center = CGPointMake(self.frame.size.width / 2, ((self.frame.size.height / 2) + topMargin));
-                             fullyOpen = YES;
+                         if (weakSelf) {
+                             __strong typeof(weakSelf) strongSelf = weakSelf;
+                             if (strongSelf.fullyOpen)
+                             {
+                                 
+                                 strongSelf.center = CGPointMake(strongSelf.frame.size.width / 2, -((strongSelf.frame.size.height / 2) + strongSelf->topMargin));
+                                 strongSelf.fullyOpen = NO;
+                             }
+                             else
+                             {
+                                 strongSelf.center = CGPointMake(strongSelf.frame.size.width / 2, ((strongSelf.frame.size.height / 2) + strongSelf->topMargin));
+                                 strongSelf.fullyOpen = YES;
+                             }
                          }
+                         
                      }
                      completion:^(BOOL finished){
-                         [delegate pullDownAnimated:fullyOpen];
+                         if (weakSelf) {
+                             __strong typeof(weakSelf) strongSelf = weakSelf;
+                             [strongSelf.delegate pullDownAnimated:strongSelf.fullyOpen];
+                         }
+                         
                      }];
 }
 
 - (void)animateDropDown:(CGPoint) position
 {
     
+    __weak typeof(self) weakSelf = self;
     [UIView animateWithDuration: animationDuration
                           delay: 0.0
                         options: UIViewAnimationOptionCurveEaseOut
                      animations:^{
-                         if (fullyOpen)
-                         {
-                             
-                             self.center = CGPointMake(self.frame.size.width / 2+position.x, -((self.frame.size.height / 2)+position.y + topMargin));
-                             fullyOpen = NO;
-                         }
-                         else
-                         {
-                             self.center = CGPointMake(self.frame.size.width / 2+position.x, ((self.frame.size.height / 2)+position.y + topMargin));
-                             fullyOpen = YES;
+                         if (weakSelf) {
+                             __strong typeof(weakSelf) strongSelf = weakSelf;
+                             if (strongSelf.fullyOpen)
+                             {
+                                 
+                                 strongSelf.center = CGPointMake(strongSelf.frame.size.width / 2+position.x, -((strongSelf.frame.size.height / 2)+position.y + strongSelf->topMargin));
+                                 strongSelf.fullyOpen = NO;
+                             }
+                             else
+                             {
+                                 strongSelf.center = CGPointMake(strongSelf.frame.size.width / 2+position.x, ((strongSelf.frame.size.height / 2)+position.y + strongSelf->topMargin));
+                                 strongSelf.fullyOpen = YES;
+                             }
                          }
                      }
                      completion:^(BOOL finished){
-                         [delegate pullDownAnimated:fullyOpen];
+                         if (weakSelf) {
+                             __strong typeof(weakSelf) strongSelf = weakSelf;
+                             [strongSelf.delegate pullDownAnimated:strongSelf.fullyOpen];
+                         }
+                         
                      }];
 }
 
@@ -438,7 +455,7 @@
     
     BOOL isStatusBarShowing = ![[UIApplication sharedApplication] isStatusBarHidden];
     
-    if (UIInterfaceOrientationIsLandscape(self.window.rootViewController.interfaceOrientation)) {
+    if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) {
         if (isStatusBarShowing) { topMargin = [UIApplication.sharedApplication statusBarFrame].size.width; }
         topMargin += topMarginLandscape;
     }

+ 37 - 29
Apex Mobile/Apex Mobile/RANetwork.m

@@ -116,7 +116,7 @@
     if(![NetworkUtils IsNetworkAvailable])
         return RESULT_NET_NOTAVAILABLE;
     
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     
     
     NSMutableDictionary * params = [[NSMutableDictionary alloc] init];
@@ -216,7 +216,7 @@
     {
         
         UIApplication * app = [UIApplication sharedApplication];
-        AppDelegate *appDelegate = [app delegate];
+        AppDelegate *appDelegate = (AppDelegate *)[app delegate];
         int result = [[jsobj valueForKey:@"result"] intValue];
         if(result!=AP_USER_AUTH)
         {
@@ -426,7 +426,7 @@
         detailContent.result_code = RESULT_NET_NOTAVAILABLE;
         return detailContent;
     }
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
         [params setValue:@"handset_search" forKey:@"action"];
 //    [params setValue:appDelegate.sessionid forKey:@"sessionid"];
     NSData* json=[self get_json:URL_REQUEST_RECORDS parameters:params file:nil];
@@ -548,7 +548,7 @@
     DebugLog(@"get_pagedata");
     if(![NetworkUtils IsNetworkAvailable])
         return nil;
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     [params setValue:@"handset_search" forKey:@"action"];
 //    [params setValue:appDelegate.sessionid forKey:@"sessionid"];
     NSData* json=[self get_json:URL_REQUEST_RECORDS parameters:params  file:nil];
@@ -597,7 +597,7 @@
     DebugLog(@"get_recordcount");
     if(![NetworkUtils IsNetworkAvailable])
         return RESULT_NET_NOTAVAILABLE;
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     [params setValue:@"handset_search_count" forKey:@"action"];
 //    [params setValue:appDelegate.sessionid forKey:@"sessionid"];
     
@@ -658,7 +658,9 @@
 +(void)post_without_return : (NSString*) url parameters:(NSMutableDictionary *) params //delegate:(id < NSURLConnectionDelegate >)delegate
 {
     
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+//    [self get_json:url parameters:params file:nil err_recorder:nil result_handler:nil decrypt_handler:nil];
+    
+//    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     //分界线的标识符
     NSString *TWITTERFON_FORM_BOUNDARY = @"AaB03x";
     //根据url初始化request
@@ -675,19 +677,19 @@
     //    NSData* data = UIImagePNGRepresentation(image);
     //http body的字符串
     NSMutableString *body=[[NSMutableString alloc]init];
-    
+
     //    NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
     //     [params setValue:@"handset_login" forKey:@"action"];
     //    [headers setValue:[NSString stringWithFormat:@"%d",dataLength] forKey:@"Content-Length"];
-    
+
 //    [params setValue:appDelegate.sessionid forKey:@"sessionid"];
     //   [params setValue:password forKey:@"password"];
     //    [params setValue:[NSString stringWithFormat:@"%d",ver]  forKey:@"auth_ver"];
-    
-    
-    
+
+
+
     //    [headers setValue:headQuerlString forKey:@"param"];
-    
+
     //参数的集合的所有key的集合
     NSArray *keys= [params allKeys];
     DebugLog(@"================parms==================");
@@ -715,7 +717,7 @@
     [body appendFormat:@"Content-Disposition: form-data; name=\"pic\"; filename=\"boris.png\"\r\n"];
     //声明上传文件的格式
     [body appendFormat:@"Content-Type: image/png\r\n\r\n"];
-    
+
     //声明结束符:--AaB03x--
     NSString *end=[[NSString alloc]initWithFormat:@"\r\n%@",endMPboundary];
     //声明myRequestData,用来放入http body
@@ -726,7 +728,7 @@
     //    [myRequestData appendData:data];
     //加入结束符--AaB03x--
     [myRequestData appendData:[end dataUsingEncoding:NSUTF8StringEncoding]];
-    
+
     //设置HTTPHeader中Content-Type的值
     NSString *content=[[NSString alloc]initWithFormat:@"multipart/form-data; boundary=%@",TWITTERFON_FORM_BOUNDARY];
     //设置HTTPHeader
@@ -737,18 +739,20 @@
     [request setHTTPBody:myRequestData];
     //http method
     [request setHTTPMethod:@"POST"];
-    
-    
-    NSHTTPURLResponse* urlResponse = nil;
-    
-    NSError *error = [[NSError alloc] init];
-    
+
+
+//    NSHTTPURLResponse* urlResponse = nil;
+//
+//    NSError *error = [[NSError alloc] init];
+//
     [NSURLConnection sendAsynchronousRequest:request queue:nil completionHandler:^(NSURLResponse *response,NSData *data,NSError *error){}];
     //    NSURLConnection *connection = [[NSURLConnection alloc]initWithRequest:request delegate:nil];
     
     
     
 }
+
+
 +(NSData*)get_marketnews : (NSString*) id limit: (int) limit
 {
     if(![NetworkUtils IsNetworkAvailable])
@@ -778,7 +782,7 @@
     
     
     
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     
     //    NSString* sess
     
@@ -832,7 +836,7 @@
     if(![NetworkUtils IsNetworkAvailable])
         return RESULT_NET_NOTAVAILABLE;//RESULT_NET_NOTAVAILABLE;
     
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     
     //    NSString* sess
     
@@ -878,7 +882,7 @@
     
     
     
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     
     //    NSString* sess
     
@@ -1154,12 +1158,12 @@
     if(![NetworkUtils IsNetworkAvailable])
         return ;//RESULT_NET_NOTAVAILABLE;
     NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     if(appDelegate.duid !=nil)
         [params setValue:appDelegate.duid forKey:@"udid"];
     [params setValue:@"handset_logout" forKey:@"action"];
     
-    [self post_without_return :URL_UPDATE_AUTH parameters:params  ];
+    [self post_without_return :URL_UPDATE_AUTH parameters:params];
 }
 +(int)Authorize : (NSString*) user password:(NSString*) password{
     
@@ -1167,14 +1171,18 @@
         return RESULT_NET_NOTAVAILABLE;
     //    if(![RANetwork IsHostAvailable:URL_UPDATE_AUTH])
     //        return RESULT_NET_ERROR;
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
     
-    long ver = appDelegate.authVer;
     
+    __block long ver = 0;
     NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
     
-    if(appDelegate.duid !=nil)
-        [params setValue:appDelegate.duid forKey:@"udid"];
+    dispatch_async(dispatch_get_main_queue(), ^{
+        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+        ver = appDelegate.authVer;
+        if(appDelegate.duid !=nil)
+            [params setValue:appDelegate.duid forKey:@"udid"];
+    });
+    
     [params setValue:@"handset_login" forKey:@"action"];
     //    [headers setValue:[NSString stringWithFormat:@"%d",dataLength] forKey:@"Content-Length"];
     

+ 29 - 9
Apex Mobile/Apex Mobile/RetrievePasswordViewController.m

@@ -24,7 +24,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }
@@ -40,9 +40,16 @@
 
     if(user.length==0||email.length==0)
     {
-        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_uecanotempty", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
-        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
-        [alert show];
+        
+        UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_uecanotempty", nil) preferredStyle:UIAlertControllerStyleAlert];
+        UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            
+        }];
+        
+        [alertVC addAction:action];
+        
+        [self presentViewController:alertVC animated:YES completion:nil];
+        
         return;
     }
     
@@ -67,15 +74,28 @@
                 
                 [self dismissViewControllerAnimated:true completion:^{
                     
-                    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_retrieve_success", nil) message:NSLocalizedString(@"alert_msg_email_sent", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
-                    [alert show];
-                    ;
+                    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_retrieve_success", nil) message:NSLocalizedString(@"alert_msg_email_sent", nil) preferredStyle:UIAlertControllerStyleAlert];
+                    UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                        
+                    }];
+                    
+                    [alertVC addAction:action];
+                    
+                    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+                    [appDelegate.window.rootViewController presentViewController:alertVC animated:YES completion:nil];
                 }];
             }
             else
             {
-                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_error", nil) message:[NSString stringWithFormat:NSLocalizedString(@"alert_msg_failed_retrieve_password", nil),ret] delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
-                [alert show];
+                
+                UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_error", nil) message:[NSString stringWithFormat:NSLocalizedString(@"alert_msg_failed_retrieve_password", nil),ret] preferredStyle:UIAlertControllerStyleAlert];
+                UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                    
+                }];
+                
+                [alertVC addAction:action];
+                
+                [self presentViewController:alertVC animated:YES completion:nil];
             }
             
             

+ 1 - 1
Apex Mobile/Apex Mobile/SearchTableAdapter.m

@@ -33,7 +33,7 @@
 {
     
     
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     //    NSString* required_ver=[objheader objectForKey:@"client_ver"] ;
     //
     //    appDelegate.sessionid = [objheader valueForKey:@"sessionid"];

+ 194 - 124
Apex Mobile/Apex Mobile/SearchViewController.m

@@ -75,15 +75,15 @@
     //        return YES;
     
     NSString *title = NSLocalizedString(@"select_val", nil);//UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) ? @"Select value" : @"Select value";
-    UIActionSheet *selBool = [[UIActionSheet alloc] initWithTitle:title
-                                                         delegate:self
-                                                cancelButtonTitle:NSLocalizedString(@"no", nil)
-                                           destructiveButtonTitle:NSLocalizedString(@"clear", nil)
-                                                otherButtonTitles:NSLocalizedString(@"yes", nil),
-                              nil];
-    selBool.tag = 1;
-    //dateDialog.actionSheetStyle = self.navigationController.navigationBar.barStyle;
-    [selBool showInView:self.view];
+//    UIActionSheet *selBool = [[UIActionSheet alloc] initWithTitle:title
+//                                                         delegate:self
+//                                                cancelButtonTitle:NSLocalizedString(@"no", nil)
+//                                           destructiveButtonTitle:NSLocalizedString(@"clear", nil)
+//                                                otherButtonTitles:NSLocalizedString(@"yes", nil),
+//                              nil];
+//    selBool.tag = 1;
+//    //dateDialog.actionSheetStyle = self.navigationController.navigationBar.barStyle;
+//    [selBool showInView:self.view];
     self.boolBtntmp = sender;
     
     //    UIDatePicker *datePicker = [[UIDatePicker alloc] init];
@@ -96,6 +96,71 @@
 	// 此处编写弹出日期选择器的代码。
     //	self.textFieldtmp=textField;
     
+    __weak typeof(self) weakSelf = self;
+    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleActionSheet];
+    UIAlertAction *noAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"no", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        
+        TableCellBool *cell  = (TableCellBool *)[[weakSelf.boolBtntmp superview] superview];
+        
+        NSIndexPath *indexPath = [weakSelf.table indexPathForCell:cell];
+        if(indexPath==nil)
+        {//for ios7
+            cell  = (TableCellBool *) weakSelf.boolBtntmp.superview.superview.superview;
+            indexPath = [weakSelf.table indexPathForCell:cell];
+        }
+        
+        {
+            [weakSelf.boolBtntmp setTitle:@"No" forState:UIControlStateNormal];
+            [[weakSelf.adapter get_item:[indexPath row]] setValue:@"false" forKey:@"value"];
+        }
+        
+        
+    }];
+    
+    UIAlertAction *clearAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"no", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
+        
+        TableCellBool *cell  = (TableCellBool *)[[weakSelf.boolBtntmp superview] superview];
+        
+        NSIndexPath *indexPath = [weakSelf.table indexPathForCell:cell];
+        if(indexPath==nil)
+        {//for ios7
+            cell  = (TableCellBool *) weakSelf.boolBtntmp.superview.superview.superview;
+            indexPath = [weakSelf.table indexPathForCell:cell];
+        }
+        
+        
+        {
+            [self.boolBtntmp setTitle:@"Not set" forState:UIControlStateNormal];
+            [[weakSelf.adapter get_item:[indexPath row]] setValue:@"" forKey:@"value"];
+        }
+        
+        
+    }];
+    
+    UIAlertAction *yesAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"no", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        
+        TableCellBool *cell  = (TableCellBool *)[[weakSelf.boolBtntmp superview] superview];
+        
+        NSIndexPath *indexPath = [weakSelf.table indexPathForCell:cell];
+        if(indexPath==nil)
+        {//for ios7
+            cell  = (TableCellBool *) weakSelf.boolBtntmp.superview.superview.superview;
+            indexPath = [weakSelf.table indexPathForCell:cell];
+        }
+        
+        {
+            [weakSelf.boolBtntmp setTitle:@"Yes" forState:UIControlStateNormal];
+            [[weakSelf.adapter get_item:[indexPath row]] setValue:@"true" forKey:@"value"];
+        }
+        
+    }];
+    
+    [alertVC addAction:noAction];
+    [alertVC addAction:clearAction];
+    [alertVC addAction:yesAction];
+    
+    [self presentViewController:alertVC animated:YES completion:nil];
+    
     
 }
 - (void)viewWillAppear:(BOOL)animated
@@ -298,27 +363,32 @@
     
 }
 - (IBAction)ClearBtnOnClick:(UIButton *)sender {
-    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"attention", nil) message:NSLocalizedString(@"alert_title_confirm_clear", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"no", nil) otherButtonTitles:NSLocalizedString(@"yes", nil), nil];
-    [alert show];
+
+    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"attention", nil) message:NSLocalizedString(@"alert_title_confirm_clear", nil) preferredStyle:UIAlertControllerStyleAlert];
     
-}
-- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
-{
+    __weak typeof(self) weakSelf = self;
+    UIAlertAction *noAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"no", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        
+    }];
     
-    if(buttonIndex!=alertView.cancelButtonIndex)
-    {
-        [self.view endEditing:YES];
-        _adapter=[[SearchTableAdapter alloc] init];
-        [_adapter initfields:_function_name];
+    UIAlertAction *yesAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"yes", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
         
-        [self.table reloadData];
-    }
+        [weakSelf.view endEditing:YES];
+        weakSelf.adapter=[[SearchTableAdapter alloc] init];
+        [weakSelf.adapter initfields:weakSelf.function_name];
+        [weakSelf.table reloadData];
+        
+    }];
     
+    [alertVC addAction:noAction];
+    [alertVC addAction:yesAction];
     
+    [self presentViewController:alertVC animated:YES completion:nil];
 }
 
 
 
+
 - (IBAction)SearchBtnOnClick:(UIButton *)sender {
     
     [self.textFieldtmp endEditing:true];
@@ -412,7 +482,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }
@@ -548,9 +618,9 @@
         }
         
         if([weakSelf.textFieldtmp.restorationIdentifier isEqualToString:@"edit_from"])
-            [[_adapter get_item:[indexPath row]] setValue:[dateFormatter stringFromDate:date] forKey:@"from"];
+            [[weakSelf.adapter get_item:[indexPath row]] setValue:[dateFormatter stringFromDate:date] forKey:@"from"];
         else
-            [[_adapter get_item:[indexPath row]] setValue:[dateFormatter stringFromDate:date] forKey:@"to"];
+            [[weakSelf.adapter get_item:[indexPath row]] setValue:[dateFormatter stringFromDate:date] forKey:@"to"];
 
         
     }];
@@ -566,10 +636,10 @@
             indexPath = [weakSelf.table indexPathForCell:cell];
         }
         
-        if([self.textFieldtmp.restorationIdentifier isEqualToString:@"edit_from"])
-            [[_adapter get_item:[indexPath row]] setValue:@"" forKey:@"from"];
+        if([weakSelf.textFieldtmp.restorationIdentifier isEqualToString:@"edit_from"])
+            [[weakSelf.adapter get_item:[indexPath row]] setValue:@"" forKey:@"from"];
         else
-            [[_adapter get_item:[indexPath row]] setValue:@"" forKey:@"to"];
+            [[weakSelf.adapter get_item:[indexPath row]] setValue:@"" forKey:@"to"];
     }];
 
     UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"cancel",nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
@@ -595,103 +665,103 @@
 	
     return NO;
 }
-- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
-    
-    if(actionSheet.tag==0)
-    {
-        
-        if(buttonIndex==actionSheet.cancelButtonIndex)
-            return;
-        if(buttonIndex==actionSheet.destructiveButtonIndex)
-        {
-            self.textFieldtmp.text=nil;
-            UITableViewCell *cell  = (UITableViewCell *)[[self.textFieldtmp superview] superview];
-            
-            NSIndexPath *indexPath = [self.table indexPathForCell:cell];
-            if(indexPath==nil)
-            {//for ios7
-                cell  = (UITableViewCell *) self.textFieldtmp.superview.superview.superview;
-                indexPath = [self.table indexPathForCell:cell];
-            }
-            
-            if([self.textFieldtmp.restorationIdentifier isEqualToString:@"edit_from"])
-                [[_adapter get_item:[indexPath row]] setValue:@"" forKey:@"from"];
-            else
-                [[_adapter get_item:[indexPath row]] setValue:@"" forKey:@"to"];
-            
-        }
-        else
-        {
-            UIDatePicker *datePicker = (UIDatePicker *)[actionSheet viewWithTag:101];
-            NSDate *date = [datePicker date];
-            NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
-            //设定时间格式,这里可以设置成自己需要的格式
-            [dateFormatter setDateFormat:@"MM/dd/yyyy"];
-            //用[NSDate date]可以获取系统当前时间
-            self.textFieldtmp.text = [dateFormatter stringFromDate:date];
-            
-            
-            
-            
-            //          DebugLog(@"textFieldShouldBeginEditing  text=%@",textField.text);
-            UITableViewCell *cell  = (UITableViewCell *)[[self.textFieldtmp superview] superview];
-            //      DebugLog(@"reuseid:%@",cell.reuseIdentifier);
-            //    //    UITableViewCell *cell  = (UITableViewCell *)[[textField superview] superview];
-            
-            NSIndexPath *indexPath = [self.table indexPathForCell:cell];
-            if(indexPath==nil)
-            {//for ios7
-                cell  = (UITableViewCell *) self.textFieldtmp.superview.superview.superview;
-                indexPath = [self.table indexPathForCell:cell];
-            }
-            //        NSMutableDictionary * field =[_adapter get_item:[indexPath row]];
-            
-            if([self.textFieldtmp.restorationIdentifier isEqualToString:@"edit_from"])
-                [[_adapter get_item:[indexPath row]] setValue:[dateFormatter stringFromDate:date] forKey:@"from"];
-            else
-                [[_adapter get_item:[indexPath row]] setValue:[dateFormatter stringFromDate:date] forKey:@"to"];
-            //          DebugLog(@"textFieldShouldBeginEditing  row=%ld  type=%@",(long)[indexPath row], [field valueForKey:@"type"]);
-            //        if(![[field valueForKey:@"type"] isEqualToString:@"time"])
-            
-            
-            
-        }
-    }
-    else
-    {
-       // self.boolBtntmp = sender;
-        TableCellBool *cell  = (TableCellBool *)[[self.boolBtntmp superview] superview];
-        
-        NSIndexPath *indexPath = [self.table indexPathForCell:cell];
-        if(indexPath==nil)
-        {//for ios7
-            cell  = (TableCellBool *) self.boolBtntmp.superview.superview.superview;
-            indexPath = [self.table indexPathForCell:cell];
-        }
-        
-        if(buttonIndex==actionSheet.cancelButtonIndex)
-        {
-            [self.boolBtntmp setTitle:@"No" forState:UIControlStateNormal];
-            [[_adapter get_item:[indexPath row]] setValue:@"false" forKey:@"value"];
-        }
-        else if(buttonIndex==actionSheet.destructiveButtonIndex)
-        {
-            [self.boolBtntmp setTitle:@"Not set" forState:UIControlStateNormal];
-            [[_adapter get_item:[indexPath row]] setValue:@"" forKey:@"value"];
-        }
-        else
-        {
-            [self.boolBtntmp setTitle:@"Yes" forState:UIControlStateNormal];
-            
-//            cell.anameLabel.text =@"aaa";
-      //      [self.boolBtntmp.titleLabel setText:@"yes"];
-       //     self.boolBtntmp.titleLabel.text = @"Yes";
-            [[_adapter get_item:[indexPath row]] setValue:@"true" forKey:@"value"];
-        }
-        
-    }
-    // TODO:
-}
+//- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
+//    
+//    if(actionSheet.tag==0)
+//    {
+//        
+//        if(buttonIndex==actionSheet.cancelButtonIndex)
+//            return;
+//        if(buttonIndex==actionSheet.destructiveButtonIndex)
+//        {
+//            self.textFieldtmp.text=nil;
+//            UITableViewCell *cell  = (UITableViewCell *)[[self.textFieldtmp superview] superview];
+//            
+//            NSIndexPath *indexPath = [self.table indexPathForCell:cell];
+//            if(indexPath==nil)
+//            {//for ios7
+//                cell  = (UITableViewCell *) self.textFieldtmp.superview.superview.superview;
+//                indexPath = [self.table indexPathForCell:cell];
+//            }
+//            
+//            if([self.textFieldtmp.restorationIdentifier isEqualToString:@"edit_from"])
+//                [[_adapter get_item:[indexPath row]] setValue:@"" forKey:@"from"];
+//            else
+//                [[_adapter get_item:[indexPath row]] setValue:@"" forKey:@"to"];
+//            
+//        }
+//        else
+//        {
+//            UIDatePicker *datePicker = (UIDatePicker *)[actionSheet viewWithTag:101];
+//            NSDate *date = [datePicker date];
+//            NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
+//            //设定时间格式,这里可以设置成自己需要的格式
+//            [dateFormatter setDateFormat:@"MM/dd/yyyy"];
+//            //用[NSDate date]可以获取系统当前时间
+//            self.textFieldtmp.text = [dateFormatter stringFromDate:date];
+//            
+//            
+//            
+//            
+//            //          DebugLog(@"textFieldShouldBeginEditing  text=%@",textField.text);
+//            UITableViewCell *cell  = (UITableViewCell *)[[self.textFieldtmp superview] superview];
+//            //      DebugLog(@"reuseid:%@",cell.reuseIdentifier);
+//            //    //    UITableViewCell *cell  = (UITableViewCell *)[[textField superview] superview];
+//            
+//            NSIndexPath *indexPath = [self.table indexPathForCell:cell];
+//            if(indexPath==nil)
+//            {//for ios7
+//                cell  = (UITableViewCell *) self.textFieldtmp.superview.superview.superview;
+//                indexPath = [self.table indexPathForCell:cell];
+//            }
+//            //        NSMutableDictionary * field =[_adapter get_item:[indexPath row]];
+//            
+//            if([self.textFieldtmp.restorationIdentifier isEqualToString:@"edit_from"])
+//                [[_adapter get_item:[indexPath row]] setValue:[dateFormatter stringFromDate:date] forKey:@"from"];
+//            else
+//                [[_adapter get_item:[indexPath row]] setValue:[dateFormatter stringFromDate:date] forKey:@"to"];
+//            //          DebugLog(@"textFieldShouldBeginEditing  row=%ld  type=%@",(long)[indexPath row], [field valueForKey:@"type"]);
+//            //        if(![[field valueForKey:@"type"] isEqualToString:@"time"])
+//            
+//            
+//            
+//        }
+//    }
+//    else
+//    {
+//       // self.boolBtntmp = sender;
+//        TableCellBool *cell  = (TableCellBool *)[[self.boolBtntmp superview] superview];
+//        
+//        NSIndexPath *indexPath = [self.table indexPathForCell:cell];
+//        if(indexPath==nil)
+//        {//for ios7
+//            cell  = (TableCellBool *) self.boolBtntmp.superview.superview.superview;
+//            indexPath = [self.table indexPathForCell:cell];
+//        }
+//        
+//        if(buttonIndex==actionSheet.cancelButtonIndex)
+//        {
+//            [self.boolBtntmp setTitle:@"No" forState:UIControlStateNormal];
+//            [[_adapter get_item:[indexPath row]] setValue:@"false" forKey:@"value"];
+//        }
+//        else if(buttonIndex==actionSheet.destructiveButtonIndex)
+//        {
+//            [self.boolBtntmp setTitle:@"Not set" forState:UIControlStateNormal];
+//            [[_adapter get_item:[indexPath row]] setValue:@"" forKey:@"value"];
+//        }
+//        else
+//        {
+//            [self.boolBtntmp setTitle:@"Yes" forState:UIControlStateNormal];
+//            
+////            cell.anameLabel.text =@"aaa";
+//      //      [self.boolBtntmp.titleLabel setText:@"yes"];
+//       //     self.boolBtntmp.titleLabel.text = @"Yes";
+//            [[_adapter get_item:[indexPath row]] setValue:@"true" forKey:@"value"];
+//        }
+//        
+//    }
+//    // TODO:
+//}
 //-(void)changedDate:(id)sender{
 //	
 //	//实例化一个NSDateFormatter对象

+ 1 - 1
Apex Mobile/Apex Mobile/TabBarController.m

@@ -33,7 +33,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }

+ 1 - 1
Apex Mobile/Apex Mobile/ToolsPanelViewController.m

@@ -28,7 +28,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }

+ 1 - 1
Apex Mobile/FavoritesViewController.m

@@ -27,7 +27,7 @@
     return YES;
 }
 
-- (NSUInteger)supportedInterfaceOrientations
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
 {
     return UIInterfaceOrientationMaskPortrait;
 }

+ 3 - 3
Apex Mobile/Launch.storyboard

@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina4_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -13,7 +13,7 @@
         <!--View Controller-->
         <scene sceneID="XyC-Av-ghC">
             <objects>
-                <viewController id="urU-mG-k2m" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="launch_vc" useStoryboardIdentifierAsRestorationIdentifier="YES" id="urU-mG-k2m" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="c56-wu-QAG">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>