鉴于此代码:
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (NSHTTPCookie *cookie in cookieStorage.cookies) {
if (/* my specific condition that is true multiple times */) {
[cookieStorage deleteCookie:cookie];
}
}
这不会抛出异常,暗示枚举过程中cookie jar的突变是安全的。我想知道的是,为什么?这是否总是安全的,还是由于某些可能发生变化的实现细节而恰好是安全的?