Explorar o código

1.修复RA Image在退出重新登录时数据未刷新。

Pen Li %!s(int64=9) %!d(string=hai) anos
pai
achega
dcc7220b0c

BIN=BIN
RA Image/RA Image.xcodeproj/project.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 8 - 2
RA Image/RA Image/RootViewController.m

@@ -36,14 +36,14 @@ static NSString *kLastMode = @"lastChooseMode";
     self.lastChoosedIndex = -1;
 
     self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Logout" style:UIBarButtonItemStylePlain target:self action:@selector(logoutItemClick:)];
-    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+
     self.title = @"Select Mode";
-    self.modeList = appDelegate.modeList;
     self.modeTable.tableFooterView = [UIView new];
     
     [self removeFirstResponderTap]; // 不然cell接受不了消息
     
     self.companyIcon = [UIImage imageNamed:@"AppIcon40x40"];
+    self.companyNameLabel.text = nil;
 }
 
 - (void)viewWillAppear:(BOOL)animated {
@@ -87,6 +87,11 @@ static NSString *kLastMode = @"lastChooseMode";
     self.companyIconView.image = companyIcon;
 }
 
+- (NSArray *)modeList {
+    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+    return appDelegate.modeList;
+}
+
 #pragma mark - DataSource
 
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
@@ -178,6 +183,7 @@ static NSString *kLastMode = @"lastChooseMode";
             [alert dismissWithClickedButtonIndex:0 animated:YES];
             AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
             if (result == RESULT_TRUE) {
+                weakself.companyIcon = [UIImage imageNamed:@"AppIcon40x40"];
                 [appDelegate logout];
             } else {
                 __strong typeof(weakself) strongself = weakself;