This is a problem that will affect many applications and can be found in Xcode 8 beta (8S128d). This is the first beta, although it is not marked as beta-1.
The problem is with NSUserDefaults; he does not work. Here, the code may be placed in application:didFinishLaunchingWithOptions:
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setValue:@"hello world" forKey:@"TEST"]; [defaults synchronize]; NSString * oops = [[NSUserDefaults standardUserDefaults] valueForKey:@"TEST"]; NSLog(@"default = %@", oops);
In Xcode 7 and earlier, this code works as expected: the oops value is "hello world."
In Xcode 8, the value of oops is nil .
This is pretty big!
xcode ios10 xcode8
Richard Jun 15 '16 at 0:19 2016-06-15 00:19
source share