Ver código fonte

ERP MOBILE增加登出后清空search 结果
修复category menu 重复加载
优化通知发送
修复category menu 弹出后,app 无法先转的bug

Ray Zhang 7 anos atrás
pai
commit
7b786ce91d

+ 7 - 11
RedAnt ERP Mobile/common/ActiveViewController.m

@@ -69,9 +69,10 @@
 
 - (void)dealloc
 {
-    [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
+#ifdef RA_NOTIFICATION
+//    [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
     [[NSNotificationCenter defaultCenter] removeObserver:self];
-
+#endif
 }
 - (void)didReceiveMemoryWarning {
     [super didReceiveMemoryWarning];
@@ -286,7 +287,6 @@
 #pragma mark - Notification
 - (void)OnUpdatePrice: (NSNotification *)notification
 {
-                dispatch_async(dispatch_get_main_queue(), ^{
                     if(self.disable_refresh)
                         return;
                     
@@ -314,7 +314,6 @@
                             self.notification_refreshLevel = NotificationRefreshLevelView;
                         }
                     }
-                });
 
     
 
@@ -322,7 +321,6 @@
 
 - (void)OnRefreshUI: (NSNotification *)notification
 {
-            dispatch_async(dispatch_get_main_queue(), ^{
                 if(self.disable_refresh)
                     return;
                 
@@ -348,12 +346,10 @@
                         self.notification_refreshLevel = NotificationRefreshLevelView;
                     }
                 }
-            });
 
 }
 - (void)OnReloadData: (NSNotification *)notification
 {
-        dispatch_async(dispatch_get_main_queue(), ^{
             if(self.disable_refresh)
                 return;
             
@@ -377,13 +373,12 @@
                     self.notification_refreshLevel = NotificationRefreshLevelData;
                 }
             }
-        });
    
     
 }
 - (void)OnClearData: (NSNotification *)notification
 {
-    dispatch_async(dispatch_get_main_queue(), ^{
+
         if(![self respondsToSelector:@selector(clear_data)])
         return;
         if([self isVisible])
@@ -406,7 +401,7 @@
                 [self clear_data];
                 self.notification_refreshLevel = NotificationRefreshLevelView;
             }
-        }});
+        }
     
 
 
@@ -426,6 +421,7 @@
 }
 +(void) Notify:(NSString*) receiver Message:(NSString*)notification_msg
 {
+        dispatch_async(dispatch_get_main_queue(), ^{
 //NSArray* arr1 =[RAConvertor string2arr:@"abcde" separator:nil];
 //    NSArray* arr2 =[RAConvertor string2arr:nil separator:nil];
     NSArray* arr_receiver = [RAConvertor string2arr:receiver separator:@","];
@@ -442,7 +438,7 @@
     [[NSNotificationCenter defaultCenter] postNotification:notification];
     return;
     
-
+});
 }
 
 

+ 9 - 0
RedAnt ERP Mobile/common/categoryMenu_RATree/RAViewController.m

@@ -117,9 +117,17 @@
   [super viewDidLoad];
     
     if(self.categoryMenu==nil)
+    {
+        self.notification_refreshLevel=NotificationRefreshLevelView;
+        
+        
     self.refresh_type = REFRESH_DATA;
+    }
     else
+    {
+        self.notification_refreshLevel=NotificationRefreshLevelView;
     self.refresh_type = REFRESH_VIEW;
+    }
     
     self.label_net_err.layer.borderColor = [UIColor darkGrayColor].CGColor;
     self.label_net_err.layer.borderWidth = 2.0;
@@ -341,6 +349,7 @@
 {
     
     UIApplication * app = [UIApplication sharedApplication];
+    
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{