Browse Source

fix : iOS 9 Crashlytics 1777-[CCMain deleteRefreshControl]

Marino Faggiana 6 years ago
parent
commit
78c59c21f7

+ 1 - 1
iOSClient/Brand/File_Provider_Extension.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<key>CFBundleShortVersionString</key>
 	<string>2.22.2</string>
 	<string>2.22.2</string>
 	<key>CFBundleVersion</key>
 	<key>CFBundleVersion</key>
-	<string>0</string>
+	<string>1</string>
 	<key>NSExtension</key>
 	<key>NSExtension</key>
 	<dict>
 	<dict>
 		<key>NSExtensionFileProviderDocumentGroup</key>
 		<key>NSExtensionFileProviderDocumentGroup</key>

+ 1 - 1
iOSClient/Brand/Notification_Service_Extension.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<key>CFBundleShortVersionString</key>
 	<string>2.22.2</string>
 	<string>2.22.2</string>
 	<key>CFBundleVersion</key>
 	<key>CFBundleVersion</key>
-	<string>0</string>
+	<string>1</string>
 	<key>NSExtension</key>
 	<key>NSExtension</key>
 	<dict>
 	<dict>
 		<key>NSExtensionPointIdentifier</key>
 		<key>NSExtensionPointIdentifier</key>

+ 1 - 1
iOSClient/Brand/Share.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<key>CFBundleShortVersionString</key>
 	<string>2.22.2</string>
 	<string>2.22.2</string>
 	<key>CFBundleVersion</key>
 	<key>CFBundleVersion</key>
-	<string>0</string>
+	<string>1</string>
 	<key>NSAppTransportSecurity</key>
 	<key>NSAppTransportSecurity</key>
 	<dict>
 	<dict>
 		<key>NSAllowsArbitraryLoads</key>
 		<key>NSAllowsArbitraryLoads</key>

+ 1 - 1
iOSClient/Brand/iOSClient.plist

@@ -69,7 +69,7 @@
 		</dict>
 		</dict>
 	</array>
 	</array>
 	<key>CFBundleVersion</key>
 	<key>CFBundleVersion</key>
-	<string>0</string>
+	<string>1</string>
 	<key>FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED</key>
 	<key>FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED</key>
 	<true/>
 	<true/>
 	<key>Fabric</key>
 	<key>Fabric</key>

+ 0 - 1
iOSClient/Main/CCMain.h

@@ -55,7 +55,6 @@
 
 
 @property (nonatomic, weak) IBOutlet UITableView *tableView;
 @property (nonatomic, weak) IBOutlet UITableView *tableView;
 @property (nonatomic, strong) tableMetadata *metadata;
 @property (nonatomic, strong) tableMetadata *metadata;
-@property (nonatomic, strong) UIRefreshControl *refreshControl;
 @property (nonatomic, strong) NSString *serverUrl;
 @property (nonatomic, strong) NSString *serverUrl;
 @property (nonatomic, strong) NSString *titleMain;
 @property (nonatomic, strong) NSString *titleMain;
 @property (nonatomic, weak) CCShareOC *shareOC;
 @property (nonatomic, weak) CCShareOC *shareOC;

+ 19 - 16
iOSClient/Main/CCMain.m

@@ -56,7 +56,7 @@
     NSUInteger _failedAttempts;
     NSUInteger _failedAttempts;
     NSDate *_lockUntilDate;
     NSDate *_lockUntilDate;
 
 
-    UIRefreshControl *_refreshControl;
+    UIRefreshControl *refreshControl;
     UIDocumentInteractionController *docController;
     UIDocumentInteractionController *docController;
 
 
     CCHud *_hud;
     CCHud *_hud;
@@ -303,8 +303,8 @@
         [appDelegate changeTheming:self];
         [appDelegate changeTheming:self];
     
     
     // Refresh control
     // Refresh control
-    _refreshControl.tintColor = [NCBrandColor sharedInstance].brandText;
-    _refreshControl.backgroundColor = [NCBrandColor sharedInstance].brand;
+    refreshControl.tintColor = [NCBrandColor sharedInstance].brandText;
+    refreshControl.backgroundColor = [NCBrandColor sharedInstance].brand;
 
 
     // color searchbar
     // color searchbar
     self.searchController.searchBar.barTintColor = [NCBrandColor sharedInstance].brand;
     self.searchController.searchBar.barTintColor = [NCBrandColor sharedInstance].brand;
@@ -434,7 +434,7 @@
 
 
 - (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView
 - (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView
 {
 {
-    if (_loadingFolder && _refreshControl.isRefreshing == NO) {
+    if (_loadingFolder && refreshControl.isRefreshing == NO) {
     
     
         UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
         UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
         activityView.transform = CGAffineTransformMakeScale(1.5f, 1.5f);
         activityView.transform = CGAffineTransformMakeScale(1.5f, 1.5f);
@@ -513,31 +513,34 @@
 
 
 - (void)createRefreshControl
 - (void)createRefreshControl
 {
 {
-    _refreshControl = [UIRefreshControl new];
+    refreshControl = [UIRefreshControl new];
     
     
     if (@available(iOS 10, *)) {
     if (@available(iOS 10, *)) {
-        _tableView.refreshControl = _refreshControl;
+        _tableView.refreshControl = refreshControl;
     } else {
     } else {
-        [_tableView addSubview:_refreshControl];
+        [_tableView addSubview:refreshControl];
     }
     }
        
        
-    _refreshControl.tintColor = [NCBrandColor sharedInstance].brandText;
-    _refreshControl.backgroundColor = [NCBrandColor sharedInstance].brand;
+    refreshControl.tintColor = [NCBrandColor sharedInstance].brandText;
+    refreshControl.backgroundColor = [NCBrandColor sharedInstance].brand;
     
     
-    [_refreshControl addTarget:self action:@selector(refreshControlTarget) forControlEvents:UIControlEventValueChanged];
+    [refreshControl addTarget:self action:@selector(refreshControlTarget) forControlEvents:UIControlEventValueChanged];
 }
 }
 
 
 - (void)deleteRefreshControl
 - (void)deleteRefreshControl
 {
 {
-    [_refreshControl endRefreshing];
+    [refreshControl endRefreshing];
     
     
     for (UIView *subview in [_tableView subviews]) {
     for (UIView *subview in [_tableView subviews]) {
-        if (subview == _refreshControl)
+        if (subview == refreshControl)
             [subview removeFromSuperview];
             [subview removeFromSuperview];
     }
     }
     
     
-    _tableView.refreshControl = nil;
-    _refreshControl = nil;
+    if (@available(iOS 10, *)) {
+        self.tableView.refreshControl = nil;
+    }
+    
+    refreshControl = nil;
 }
 }
 
 
 - (void)refreshControlTarget
 - (void)refreshControlTarget
@@ -1245,7 +1248,7 @@
 - (void)readFolderSuccessFailure:(CCMetadataNet *)metadataNet metadataFolder:(tableMetadata *)metadataFolder metadatas:(NSArray *)metadatas message:(NSString *)message errorCode:(NSInteger)errorCode
 - (void)readFolderSuccessFailure:(CCMetadataNet *)metadataNet metadataFolder:(tableMetadata *)metadataFolder metadatas:(NSArray *)metadatas message:(NSString *)message errorCode:(NSInteger)errorCode
 {
 {
     // stoprefresh
     // stoprefresh
-    [_refreshControl endRefreshing];
+    [refreshControl endRefreshing];
     
     
     // Check Active Account
     // Check Active Account
     if (![metadataNet.account isEqualToString:metadataNet.account])
     if (![metadataNet.account isEqualToString:metadataNet.account])
@@ -1362,7 +1365,7 @@
     // init control
     // init control
     if (!serverUrl || !appDelegate.activeAccount || appDelegate.maintenanceMode) {
     if (!serverUrl || !appDelegate.activeAccount || appDelegate.maintenanceMode) {
         
         
-        [_refreshControl endRefreshing];
+        [refreshControl endRefreshing];
         return;
         return;
     }
     }