Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

forcing save NSUserDefaults #13

Open
wants to merge 1 commit into from

2 participants

@hunk

forcing save NSUserDefaults, sometimes no data is saved (Xcode press run or stop)

@jaanus
Owner

Sorry, this is against Apple recommendations of letting the device itself intelligently decide when is a good time to save these defaults. Xcode run/stop events are not normal user scenarios. Maybe there should be a development mode where this happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 8, 2012
  1. @hunk
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  OAuth/Guts/OAuthTwitter.m
View
1  OAuth/Guts/OAuthTwitter.m
@@ -199,6 +199,7 @@ - (void) save {
[super save];
[[NSUserDefaults standardUserDefaults] setObject:self.user_id forKey:[NSString stringWithFormat:@"%@user_id", self.save_prefix]];
[[NSUserDefaults standardUserDefaults] setObject:self.screen_name forKey:[NSString stringWithFormat:@"%@screen_name", self.save_prefix]];
+ [[NSUserDefaults standardUserDefaults] synchronize];
}
@end
Something went wrong with that request. Please try again.