According to Apple Docs NSCalendar is not thread-safe.
How can I ensure thread-safety when I use the static method currentCalendar
?
Any library could call the same method. How can I lock the access?
You can use NSLock.
NSLock *lock = [[NSLock alloc] init];
and
[lock lock];
//calendar
[lock unlock];