diff --git a/MasterPassword/ObjC/MPAppDelegate_InApp.m b/MasterPassword/ObjC/MPAppDelegate_InApp.m index bfbce092..62c6fc35 100644 --- a/MasterPassword/ObjC/MPAppDelegate_InApp.m +++ b/MasterPassword/ObjC/MPAppDelegate_InApp.m @@ -169,6 +169,8 @@ PearlAssociatedObjectProperty( NSMutableArray*, ProductObservers, productObserve for (id productObserver in self.productObservers) [productObserver updateWithTransaction:transaction]; } + if (![[NSUserDefaults standardUserDefaults] synchronize]) + wrn( @"Couldn't synchronize after transaction updates." ); } - (void)paymentQueue:(SKPaymentQueue *)queue restoreCompletedTransactionsFailedWithError:(NSError *)error { diff --git a/MasterPassword/ObjC/MPAppDelegate_Store.m b/MasterPassword/ObjC/MPAppDelegate_Store.m index 09cc59f8..1d89941e 100644 --- a/MasterPassword/ObjC/MPAppDelegate_Store.m +++ b/MasterPassword/ObjC/MPAppDelegate_Store.m @@ -328,6 +328,8 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted ); [[NSUserDefaults standardUserDefaults] setInteger:MPStoreMigrationLevelCurrent forKey:MPStoreMigrationLevelKey]; inf( @"Successfully migrated old to new local store." ); + if (![[NSUserDefaults standardUserDefaults] synchronize]) + wrn( @"Couldn't synchronize after store migration." ); } - (BOOL)migrateV1LocalStore { diff --git a/MasterPassword/ObjC/iOS/MPCoachmarkViewController.m b/MasterPassword/ObjC/iOS/MPCoachmarkViewController.m index 40c4ec87..976c3219 100644 --- a/MasterPassword/ObjC/iOS/MPCoachmarkViewController.m +++ b/MasterPassword/ObjC/iOS/MPCoachmarkViewController.m @@ -99,6 +99,8 @@ - (void)setCoached:(BOOL)coached { [[NSUserDefaults standardUserDefaults] setBool:coached forKey:strf( @"%@.%ld.coached", self.coachedClass, (long)self.coachedVersion )]; + if (![[NSUserDefaults standardUserDefaults] synchronize]) + wrn( @"Couldn't synchronize after coachmark updates." ); } @end diff --git a/MasterPassword/ObjC/iOS/MPPreferencesViewController.m b/MasterPassword/ObjC/iOS/MPPreferencesViewController.m index c12f1b7c..f813958d 100644 --- a/MasterPassword/ObjC/iOS/MPPreferencesViewController.m +++ b/MasterPassword/ObjC/iOS/MPPreferencesViewController.m @@ -32,6 +32,8 @@ inf( @"Preferences will appear" ); [super viewWillAppear:animated]; [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"tipped.passwordsPreferences"]; + if (![[NSUserDefaults standardUserDefaults] synchronize]) + wrn( @"Couldn't synchronize after preferences appearance." ); MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserForMainThread]; self.generatedTypeControl.selectedSegmentIndex = [self generatedSegmentIndexForType:activeUser.defaultType]; diff --git a/MasterPassword/ObjC/iOS/MPStoreViewController.m b/MasterPassword/ObjC/iOS/MPStoreViewController.m index 43aa1f66..3c1e136c 100644 --- a/MasterPassword/ObjC/iOS/MPStoreViewController.m +++ b/MasterPassword/ObjC/iOS/MPStoreViewController.m @@ -37,6 +37,8 @@ PearlEnum( MPDevelopmentFuelConsumption, return nil; [[NSUserDefaults standardUserDefaults] setInteger:storeVersion forKey:@"storeVersion"]; + if (![[NSUserDefaults standardUserDefaults] synchronize]) + wrn( @"Couldn't synchronize store version update." ); return features; } diff --git a/MasterPassword/ObjC/iOS/MPWebViewController.m b/MasterPassword/ObjC/iOS/MPWebViewController.m index 6e7bc72f..9b7edd1d 100644 --- a/MasterPassword/ObjC/iOS/MPWebViewController.m +++ b/MasterPassword/ObjC/iOS/MPWebViewController.m @@ -50,8 +50,11 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { - if ([[request.URL absoluteString] rangeOfString:@"thanks.lhunath.com"].location != NSNotFound) + if ([[request.URL absoluteString] rangeOfString:@"thanks.lhunath.com"].location != NSNotFound) { [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"tipped.thanks"]; + if (![[NSUserDefaults standardUserDefaults] synchronize]) + wrn( @"Couldn't synchronize thanks tip." ); + } if ([request.URL isEqual:request.mainDocumentURL]) { self.webNavigationItem.title = request.URL.host; diff --git a/Scripts/genassets b/Scripts/genassets index 6980e354..42f44544 100755 --- a/Scripts/genassets +++ b/Scripts/genassets @@ -1,7 +1,6 @@ #!/usr/bin/env bash # See https://developer.apple.com/library/ios/qa/qa1686/_index.html cd "${BASH_SOURCE%/*}" -set -x source bashlib cd ..