title: iOS 8 freezes at updating UserDefaults object
body: <p>I have a queue of objects stored to the <code>NSUserDefaults</code>. When I need to add objects to it, I call the following method:</p>
  
  <pre><code>+ (void)addCodeToQueue:(Code *)code {
    // Note: userDefaults is a static, initialized variable
  
    NSDictionary *codeModel = [self generateCodeModelWith:code];
  
    // Read array from UserDefaults, or create one if nil
    NSMutableArray *codeQueue = [userDefaults mutableArrayValueForKey:@"CodeQueue"] ? : [[NSMutableArray alloc] init];
  
    // Add code model
    [codeQueue addObject:codeModel];
  
    // Add/replace array &amp; sync
    [userDefaults setObject:codeQueue forKey:@"CodeQueue"]; // App freezes here if uncommented
    [userDefaults synchronize];
  }
  </code></pre>
  
  <p>My app freezes when I call <code>setObject:forKey</code>. If I add a breakpoint to that line, the continue running, it works. If I don't break, it freezes.</p>
  
  <p>This started happening after I updated Xcode to version 8 and started using the new SDK.
  Any hints on this?</p>