-[NSUserDefaults synchronize] performance issue on iOS

ios, iphone, nsuserdefaults, performance

Solution

It will have a small performance impact. Maybe not something you notice. However it would still be better just to call `-[NSUserDefaults synchronize];` just once, right at the end of all your set methods calls, as it will then save all your changes then to file, rather than after each individual change.

Problem

Possible Duplicate: Best Practice for NSUserDefaults synchronize I call `-[NSUserDefault setIntegerValue:1 forKey:differentKeys];` about 50 times, and each time with a different key, then call `-[NSUserDefault synchronize];` will this be a performance impact? how many times will it be a performance impact?

Original source

Related problems