iOS 8 freezes at updating UserDefaults object

I have a queue of objects stored to the NSUserDefaults. When I need to add objects to it, I call the following method: + (void)addCodeToQueue:(Code *)code { // Note: userDefaults is a static,