Browse Source

NSUserDefaults: remove synchronized since it's outdated

from the NSUserdefaults.h :
 -synchronize is deprecated and will be marked with the NS_DEPRECATED macro in a future release.
Carola Nitz 7 years ago
parent
commit
f82802c050

+ 0 - 2
Apple-TV/Playback/Playback Info/VLCPlaybackInfoSubtitlesFetcherViewController.m

@@ -52,7 +52,6 @@
             selectedLocale = @"eng";
         }
         [defaults setObject:selectedLocale forKey:kVLCSettingLastUsedSubtitlesSearchLanguage];
-        [defaults synchronize];
     }
     _osoFetcher.subtitleLanguageId = selectedLocale;
 
@@ -204,7 +203,6 @@
                                                            handler:^(UIAlertAction * _Nonnull action) {
                                                                _osoFetcher.subtitleLanguageId = itemID;
                                                                [defaults setObject:itemID forKey:kVLCSettingLastUsedSubtitlesSearchLanguage];
-                                                               [defaults synchronize];
                                                                [self searchForMedia];
                                                                [self.tableView reloadData];
                                                            }];

+ 0 - 1
Apple-TV/Playback/Playback Info/VLCPlaybackInfoTracksTVViewController.m

@@ -141,7 +141,6 @@
         [vpc setAudioPassthrough:bValue];
 
         [defaults setBool:bValue forKey:kVLCSettingUseSPDIF];
-        [defaults synchronize];
         /* restart the audio output */
         NSInteger currentAudioTrackIndex = [vpc indexOfCurrentAudioTrack];
         [vpc selectAudioTrackAtIndex:0];

+ 0 - 2
Apple-TV/VLCSettingsViewController.m

@@ -112,7 +112,6 @@
                                                              style:UIAlertActionStyleDefault
                                                            handler:^(UIAlertAction * _Nonnull action) {
                                                                [_userDefaults setObject:value forKey:[specifier key]];
-                                                               [_userDefaults synchronize];
                                                                [self.tableView reloadData];
                                                            }];
             [alertController addAction:action];
@@ -128,7 +127,6 @@
     } else if ([specifierType isEqualToString:kIASKPSToggleSwitchSpecifier]) {
         NSString *specifierKey = [specifier key];
         [_userDefaults setBool:![_userDefaults boolForKey:specifierKey] forKey:specifierKey];
-        [_userDefaults synchronize];
         [self.tableView reloadData];
     } else {
         VLCAboutViewController *targetViewController = [[VLCAboutViewController alloc] initWithNibName:nil bundle:nil];

+ 0 - 5
Sources/VLCAppDelegate.m

@@ -433,11 +433,6 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
     }
 }
 
-- (void)applicationWillTerminate:(UIApplication *)application
-{
-    [[NSUserDefaults standardUserDefaults] synchronize];
-}
-
 - (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler
 {
     [[VLCSidebarController sharedInstance] performActionForShortcutItem:shortcutItem];

+ 0 - 1
Sources/VLCLibraryViewController.m

@@ -269,7 +269,6 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
     if (![[defaults objectForKey:kDisplayedFirstSteps] boolValue]) {
         [self.emptyLibraryView performSelector:@selector(learnMore:) withObject:nil afterDelay:1.];
         [defaults setObject:[NSNumber numberWithBool:YES] forKey:kDisplayedFirstSteps];
-        [defaults synchronize];
     }
 
     if ([_mediaDataSource numberOfFiles] < 1)

+ 0 - 1
Sources/VLCOpenNetworkStreamViewController.m

@@ -150,7 +150,6 @@
     NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
     [defaults setBool:self.privateToggleSwitch.on forKey:kVLCPrivateWebStreaming];
     [defaults setBool:self.ScanSubToggleSwitch.on forKey:kVLChttpScanSubtitle];
-    [defaults synchronize];
 
     /* force update before we leave */
     [[NSUbiquitousKeyValueStore defaultStore] synchronize];